Adding button to a jtable

前端 未结 1 1636
遥遥无期
遥遥无期 2021-01-22 20:14

I am having a table in which i have to adda JButton.

I am doing

TableColumnModel colModel = table.getColumnModel();
    colModel.getColumn(0).setCellEd         


        
相关标签:
1条回答
  • 2021-01-22 21:15

    The article Table Button Column cited in @camickr's previous answer provides a more flexible solution, but you may find the tutorial How to Use Tables: Using Other Editors helpful, too. The ColorEditor discussed there is part of the TableDialogEditDemo, available via Java Web Start. You'll need to change the corresponding ColorRenderer accordingly.

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