protected JPanel buildButtonPanel() { JPanel pnl = new JPanel(new FlowLayout(FlowLayout.CENTER)); // -- apply button ApplyAction applyAction = buildApplyAction(); pnlTagConflictResolver.getModel().addPropertyChangeListener(applyAction); pnlRelationMemberConflictResolver.getModel().addPropertyChangeListener(applyAction); btnApply = new SideButton(applyAction); btnApply.setFocusable(true); pnl.add(btnApply); // -- cancel button CancelAction cancelAction = new CancelAction(); pnl.add(new SideButton(cancelAction)); // -- help button helpAction = new ContextSensitiveHelpAction(); pnl.add(new SideButton(helpAction)); return pnl; }
protected void makeButtonRespondToEnter(SideButton btn) { btn.setFocusable(true); btn.getInputMap(JComponent.WHEN_FOCUSED) .put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "enter"); btn.getActionMap().put("enter", btn.getAction()); }