How to change values of panel on selecting a row in a table : jgoodies
Pergunta
I am using Jgoodies binding to bind the table with my data. What listener i should implement so that when a cell is selected the values in a panel are changed.
My model class of table extends AbstractTableAdapter which is an Jgoodies binding class.
thanks
Solução
The ListSelectionModel
in your JTable
(or suitable subclass) is what triggers events when the rows in a table are selected. You can implement ListSelectionListener
and grab the selection model from the JTable
and add yourself as a listener.
Outras dicas
i was able to do it as follows
myTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
System.out.println("hi");
}
});
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow