Methods Summary |
---|
public int | getColumnCount() return data[0].length;
|
public int | getRowCount() return data.length;
|
public java.lang.Object | getValueAt(int row, int col)
if ( data[row][col] != null )
try { return data[row][col].eval( ) + ""; }
catch ( BadExpression e ) { return "Error"; }
return "";
|
public boolean | isCellEditable(int row, int col) return true;
|
public static void | main(java.lang.String[] args)
JFrame frame = new JFrame("Excelsior!");
frame.addWindowListener(new WindowAdapter( ) {
public void windowClosing(WindowEvent we) { System.exit(0); }
});
JTable table = new JTable( new SpreadsheetModel(15, 5) );
table.setPreferredScrollableViewportSize(
table.getPreferredSize( ) );
table.setCellSelectionEnabled(true);
frame.getContentPane( ).add( new JScrollPane( table ) );
frame.pack(); frame.show( );
|
public void | setValueAt(java.lang.Object value, int row, int col)
data[row][col] = new Expression( (String)value );
fireTableDataChanged( );
|