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!");
JTable table = new JTable( new SpreadsheetModel(15, 5) );
table.setPreferredScrollableViewportSize( table.getPreferredSize() );
table.setCellSelectionEnabled(true);
frame.getContentPane().add( new JScrollPane( table ) );
frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
frame.pack();
frame.setVisible(true);
|
public void | setValueAt(java.lang.Object value, int row, int col)
data[row][col] = new Expression( (String)value );
fireTableDataChanged( );
|