tags:

views:

32

answers:

1

I have a JTable of data. I want it so that when a row is selected, an event can occur. With a JList, I would simply add a ListSelectionListener. Any way to do this with a JTable?

+5  A: 

You can still use your ListSelectionListener with JTable too (take a look at the JavaDocs of ListSelectionListener: JTable also implements it, so you would use it like for your JList).

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

A. Ionescu
Wow, can't believe I didn't see that before. Thanks!
Earl Bellinger