我在java中使用了JTable,但它不會讓我編輯單元格。如何在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);
確保你花時間通過[如何使用表(http://docs.oracle.com/javase/tutorial/uiswing閱讀/components/table.html) – MadProgrammer