0

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?

2
  • 1
    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.
    – dic19
    Jan 6, 2015 at 11:37
  • 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. Jan 9, 2015 at 5:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.