【发布时间】:2013-04-15 05:22:14
【问题描述】:
我在 java 中使用 JTable,但它不允许我编辑单元格。
private final TableModel dataModel = new AbstractTableModel() {
public int getColumnCount() {
return 5;
}
public int getRowCount() {
return 10;
}
public Object getValueAt(int row, int col) {
return new Integer(row*col);
}
};
private final JTable table = new JTable(dataModel);
【问题讨论】:
-
确保您花时间阅读How to use Tables