Good people! I have a Jframe with 2 tables, what I want to do is pass data from one table to the other with a mouseclicked event, which I have achieved, but only one column loads me, that is, if I click with something else from the first table and I load it in the place of the one that was previously selected (in the second table) I leave my code to see if anyone can help me! thank you! []
int FC = tabla1.getSelectedRow();
cargartabla2();
try{
String codigo,numero,importe;
if(FC != -1){
dtm= (DefaultTableModel)tabla1.getModel();
codigo = tabla1.getValueAt(FC, 0).toString();
numero=tabla1.getValueAt(FC, 1).toString();
importe=tabla1.getValueAt(FC, 2).toString();
dtm= (DefaultTableModel)tabla2.getModel();
Object fila[] = {codigo,numero,importe};
dtm.addRow(fila);
}
}catch(Exception e ){
}