Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Excel-like JTable Cell Editor, with an empty cell at edition start
- public void propertyChange(PropertyChangeEvent e)
- {
- // A cell has started/stopped editing
- if ("tableCellEditor".equals(e.getPropertyName()))
- {
- if (table.isEditing())
- processEditingStarted();
- else
- processEditingStopped();
- }
- }
- private void processEditingStarted()
- {
- SwingUtilities.invokeLater( this );
- }
- public void run()
- {
- row = table.convertRowIndexToModel( table.getEditingRow() );
- column = table.convertColumnIndexToModel( table.getEditingColumn() );
- oldValue = table.getModel().getValueAt(row, column);
- newValue = null;
- table.getModel().setValueAt(null, row, column);
- table.updateUI();
- }
Add Comment
Please, Sign In to add comment