No, the right component for showing tabular data is JTable.
You want to add a listener to the TableModel that's underneath the table. That will fire off events whenever data changes. You get it out of JTable, unsurprisingly enough, by calling getTableModel()
.
Update
Oh wait, I think I misunderstood you. You're not interested in data changes but column selection changes.
JTable has a method called columnSelectionChanged
; its documentation says it's called by TableColumnModelListener
, which leads me to believe that what you want to do is getColumnModel()
and use the addColumnModelListener()
method of that to listen for column selection changes.