public void letterOrDigitTyped() { table.setAllowEditing(true); table.repaint(); // G.Sturr 2009-10-10: cleanup when keypress edit begins // check if cell fixed Object o = model.getValueAt(table.getSelectedRow(), table.getSelectedColumn()); if (o != null && o instanceof GeoElement) { GeoElement geo = (GeoElement) o; if (geo.isFixed()) return; } model.setValueAt(null, table.getSelectedRow(), table.getSelectedColumn()); table.editCellAt(table.getSelectedRow(), table.getSelectedColumn()); // workaround, see // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4192625 final JTextComponent f = (JTextComponent) table.getEditorComponent(); f.requestFocus(); f.getCaret().setVisible(true); // workaround for Mac OS X 10.5 problem (first character typed deleted) if (Application.MAC_OS) SwingUtilities.invokeLater( new Runnable() { public void run() { f.setSelectionStart(1); f.setSelectionEnd(1); } }); table.setAllowEditing(false); }