本文介绍了JTable列标题不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
列标题在我的JTable中不可见我创建了一个JPanel并将JTable添加到JPanel。
column header not visible in my JTable i have created a JPanel and added the JTable to the JPanel.
Object rowData[][] = { { "Row1-Column1", "Row1-Column2", "Row1-Column3"},
{ "Row2-Column1", "Row2-Column2", "Row2-Column3"} };
Object columnNames[] = { "Column One", "Column Two", "Column Three"};
JTable jTable = new JTable(rowData, columnNames);
推荐答案
JTable的API声明:
The API for JTable states:
或者只需将表格添加到滚动窗格,然后添加你的滚动窗格到面板......
Or just add the table to a scrollpane, and add your scrollpane to the panel...
这篇关于JTable列标题不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!