Cyril Horad Cyril Horad - 13 days ago 8
Java Question

Why does JTable always trigger ListSelectionListener twice?

Is it normal that any changes to the selected row of the

JTable
will trigger the added
ListSelectionListener
twice?

Is it possible that the
ListSelectionListener
can be triggered only once?

Answer

Look at the event that is passed to your listener, specifically

ListSelectionEvent.getValueIsAdjusting() 

perform whatever ops you want to do when this returns false.