Using JTable as a JList

I have a jtable data. I want an event to occur when a row is selected. With a JList, I would just add a ListSelectionListener. Any way to do this with JTable?

+3
source share
1 answer

You can also use your ListSelectionListener with JTable (see JavaDocs ListSelectionListener : JTable also implements it, so you will use it as for your JList).

See an example (but if you've already used it with a JList, you know how to use it with JTable too).

+5
source

Source: https://habr.com/ru/post/1755372/


All Articles