我有一个 JTable:
JTable table = new JTable();
String[] colNames = {"c1"};
DefaultTableModel model = new DefaultTableModel();
Integer[] x = new Integer[10];
int[] xi = {0,1,2,3,4,5,6,7,8,9};
for (int i=0; i<10; i++){
x[i]=new Integer(xi[i]);
}model.addColumn("c1");
table.setModel(model);
table.setEnabled(false);
table.setAutoCreateRowSorter(true);
JScrollPane scrollpane = new JScrollPane(table);
contentPane.add(scrollpane);
现在,当我加载它并单击列标题时,行排序就像它们是字符串一样:
0,10...(按长度顺序)
我怎样才能改变它,以便他们以数字方式订购?