Java JTable getting the data of the selected row

前端 未结 4 1989
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-01 18:43

Are there any methods that are used to get the data of the selected row? I just want to simply click a specific row with data on it and cli

4条回答
  •  北海茫月
    2021-01-01 19:45

    http://docs.oracle.com/javase/7/docs/api/javax/swing/JTable.html

    You will find these methods in it:

    getValueAt(int row, int column)
    getSelectedRow()
    getSelectedColumn()
    

    Use a mix of these to achieve your result.

提交回复
热议问题