Add a title to a JTable

前端 未结 4 1355
醉酒成梦
醉酒成梦 2021-01-19 07:48

I have a JTable which is created using a TableModel JTable t = new JTable(tableModel) I want to add a title to it. I was hoping for something like t.setTi

4条回答
  •  天命终不由人
    2021-01-19 08:12

    I don't think you have much options here. JTable has no functionality to add a titlebar. So using JLabel or other components is your only option. Try putting the JTable in a JTabbedPane.

提交回复
热议问题