How to add buttons inside a cell of jtable and give it action

后端 未结 1 1655
执念已碎
执念已碎 2020-12-07 03:54

i know this has been answered before but considering im still a newbie i cant figure out a way to give actions and block the cell editing, i have tried it in several ways,i

相关标签:
1条回答
  • 2020-12-07 04:34

    You need both a renderer and and editor, as shown in this example. See How to Use Tables: Editors and Renderers for details. Tangentially, you should override the method isCellEditable() in your TableModel rather than extending JTable.

    0 讨论(0)
提交回复
热议问题