JTable - Selected Row click event

前端 未结 5 939
名媛妹妹
名媛妹妹 2021-02-02 09:36

I have a Jtable that is populated with a linkedlist through an AbstractTableModel.

What I want to do is when I click (left-mouse click) on a row in the JTable, the linke

5条回答
  •  温柔的废话
    2021-02-02 09:51

    To learn what row was selected, add a ListSelectionListener, as shown in How to Use Tables in the example SimpleTableSelectionDemo. A JList can be constructed directly from the linked list's toArray() method, and you can add a suitable listener to it for details.

提交回复
热议问题