void (final TableUI ui) { super.setUI(ui); // Customize action and input maps @NonNls final ActionMap actionMap=getActionMap(); @NonNls final InputMap focusedInputMap=getInputMap(JComponent.WHEN_FOCUSED); @NonNls final InputMap ancestorInputMap=getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); actionMap.put(TableActions.Up.ID, new MySelectPreviousRowAction()); actionMap.put(TableActions.Down.ID, new MySelectNextRowAction()); actionMap.put("startEditing",new MyStartEditingAction()); focusedInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_F2,0),"startEditing"); ancestorInputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_F2,0)); actionMap.put("smartEnter",new MyEnterAction()); focusedInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0),"smartEnter"); ancestorInputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0)); focusedInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0),"cancel"); ancestorInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0),"cancel"); actionMap.put("expandCurrent", new MyExpandCurrentAction(true)); focusedInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ADD,0),"expandCurrent"); ancestorInputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_ADD,0)); actionMap.put("collapseCurrent", new MyExpandCurrentAction(false)); focusedInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT,0),"collapseCurrent"); ancestorInputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT,0)); }