How to pass data from two Jtables to a form?

0

I want a form to be fed from two tables but it happens that I select the data of a table and when selecting those of the second, the ones of the first one are deleted ... my selection code is the following for one of the tables: Location ub = new Location ();        int row = table.getSelectedRow ();

   String Codigos=tabla.getValueAt(row, 0).toString();
   String nombres=tabla.getValueAt(row, 1).toString();

   ub.generocod.setText(Codigos);
   ub.gennom.setText(nombres);
   ub.setVisible(true);
   dispose();

and this for the other:  public void seleccion () {            Location ub = new Location ();        int row = table.getSelectedRow ();

   String Codigos=tabla.getValueAt(row, 0).toString();
   String nombres=tabla.getValueAt(row, 1).toString();

   ub.ubicanom.setText(Codigos);
   ub.ubicacod.setText(nombres);
   ub.setVisible(rootPaneCheckingEnabled);
   dispose();





   }

I clarify that they are two different Jframes.

    
asked by Ronald Ure 02.06.2018 в 19:46
source

0 answers