super("Abstract Model JTable Test");
setSize(300, 200);
addWindowListener(new BasicWindowMonitor());
TableModel tm = new AbstractTableModel() {
String[][] data = { {"This", "is"}, {"a", "Test"} };
String[] headers = {"Column", "Header"};
public int getRowCount() { return data.length; }
public int getColumnCount() { return headers.length; }
public Object getValueAt(int r, int c) { return data[r][c]; }
public String getColumnName(int c) { return headers[c]; }
};
JTable jt = new JTable(tm);
JScrollPane jsp = new JScrollPane(jt);
getContentPane().add(jsp, BorderLayout.CENTER);