Cuestion de programacion java

Supongo que será algo muy sencillo pero mi duda es la siguiente
Tengo un programa que trabaja con php, y en una tabla tengo que recoger las ids de las claves primarias, la cosa es que las recoge y las muestro en un comboBox. Pero necesito que cada vez que me muevo por la tabla, o hago un mouseClicked me recoja lo que hay dentro de la fila seleccionada de la tabla y se muestre en el jcomboBox

Lo que tengo por ahora es para el mouseclicked
table.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {

int row = table.rowAtPoint(e.getPoint());

textAltura.setText((String) table.getValueAt(row, 0).toString());
textCapa.setText((String) table.getValueAt(row, 1).toString());
textSexo.setText((String) table.getValueAt(row, 2).toString());
textPoder.setText((String) table.getValueAt(row, 3).toString());
textEdad.setText((String) table.getValueAt(row, 4).toString());
cbIDCiudad.setSelectedItem(table.getValueAt(row, 5));
textFieldID.setText((String) table.getValueAt(row, 6).toString());
textNombreHeroe.setText((String) table.getValueAt(row, 7).toString());
cbIDOrganizacion.setSelectedItem(table.getValueAt(row, 8));

}

});

Y para moverme por las tablas:

table.setRowSelectionInterval(table.getSelectedRow()+1,table.getSelectedRow()+1);
textAltura.setText((String) table.getValueAt(table.getSelectedRow(), 0).toString());
textCapa.setText((String) table.getValueAt(table.getSelectedRow(), 1).toString());
textSexo.setText((String) table.getValueAt(table.getSelectedRow(), 2).toString());
textPoder.setText((String) table.getValueAt(table.getSelectedRow(), 3).toString());
textEdad.setText((String) table.getValueAt(table.getSelectedRow(), 4).toString());
cbIDCiudad.setSelectedItem(table.getValueAt(table.getSelectedRow(), 5).toString());
textFieldID.setText((String) table.getValueAt(table.getSelectedRow(), 6).toString());
textNombreHeroe.setText((String) table.getValueAt(table.getSelectedRow(), 7).toString());
cbIDOrganizacion.setSelectedItem(table.getValueAt(table.getSelectedRow(), 8).toString());

Gracias de antemano
0 respuestas