下午好。我对 a 的属性有一个有趣的问题JXtable
。
问题是我创建的JXTable
列太多了,所以我决定让用户选择使用SwingX 库中ColumnControlButton
默认提供的列来显示哪一列。JXTable
由于我的列太多,当我按下ColumnControl
按钮时,它不会显示所有可以隐藏/显示的列。默认情况下ColumnControl
不带有可滚动的属性来管理这种情况。我需要某种代码,例如与JXTable
.. 一起使用的代码。我不知道,也许类似于.setHorizontalScrollEnabled(true)
,所以我可以看到ColumnControl
.
我提前感谢您的回答,伙计们...
顺便说一下,这是加载表格的代码:
public static void load_resg() throws Exception{
String[] titles = new String[80];
for(int i=0; i<80; i++){
titles[i]=NbP[i];
}
modelResg=new DefaultTableModel(null, titles){
@Override
public boolean isCellEditable(int i, int i1) {
return false; //To change body of generated methods, choose Tools | Templates.
}
};
BufferedReader bw = new BufferedReader(new FileReader("Out\\Depth.txt"));
String line;
while((line=bw.readLine())!=null){
modelResg.addRow(line.split(";"));
}
bw.close();
resg.setIntercellSpacing(new Dimension(5, 5));
resg.setHighlighters(HighlighterFactory.createSimpleStriping());
resg.setHorizontalScrollEnabled(true);
resg.packSelected();
resg.setSortable(true);
resg.getColumnControl();
resg.setColumnControlVisible(true);
resg.setModel(modelResg);
}