I need a method that executes when I change the row in a JTable. How do I achieve that? There is a listener for a JTable but it is used when the table is changed, not when you move accross the table. (I am rather new to Java). Can anyone help?
If by "row change" you mean the row's selection change then see Users selection section in How to Use Tables tutorial. Basically you need to attach a ListSelectionListener to the table's selection model.
Yes, I meant that. I have realized that when you move accros a table you are "selecting" cells, then it is easy to get the row or column numbers. So, thank you. I am into that right now.
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
ListSelectionListener
to the table's selection model.