TableModel示例

class MyTableModel extends DefaultTableModel {
 private static final long serialVersionUID = 7696733103182844830L;

 public PoTableModel(Object[][] data, Object[] head) {
  super(data, head);
 }

 public boolean isCellEditable(int row, int column) {
  return false;
 }

 public Class getColumnClass(int column) {
  if (column == 0) {
   return Integer.class;
  }
  return String.class;
 }
}

你可能感兴趣的:(TableModel示例)