2

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

harshit
  • 7,925
  • 23
  • 70
  • 97

2 Answers2

1

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.

akf
  • 38,619
  • 8
  • 86
  • 96
0

i was able to do it as follows

myTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {

        public void valueChanged(ListSelectionEvent e) {
        System.out.println("hi");

        }
    });
harshit
  • 7,925
  • 23
  • 70
  • 97