-1
我有一个包含列数的表。我通过createCell方法添加了一列CheckBox组件。该添加的列应该是第一列(索引0的列)。添加一列后,另一列隐藏在我的表
我的问题只是当我运行的代码先前的第一列(学生号码)不显示。 在我看来,添加的列覆盖了下一列。
请问如何解决这个问题?
TableModel model = new DefaultTableModel(new String[] {"Student-Number","Student-name","Degree"} ,ob) {
public boolean isCellEditable(int row, int col)
{
return true;
}
};
Table table = new Table(model,true)
{
protected Component createCell(Object value, final int row,
final int column, boolean editable) {
if (column == 0)
{
CheckBox cod= new CheckBox ("cod");
return cod;
}
return super.createCell(value, row, column, editable);
}
} ;
为了更快提供更好的帮助,请发布[SSCCE](http://sscce.org/)。 –
是的同意(不包括99%的用户在这里)我们这里不是代码引擎............... – mKorbel
请赐教我是我的代码长还是不独立? – JavaFan