开发者

Using a JTable as a JList

I have a JTable of data. I 开发者_如何学Gowant 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?


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜