List of utility methods to do JButton Escape
void | addEscListener(JComponent c, final JButton b) This method implements hotkey binding for [Esc] for currently focused JComponent with a "Cancel" Button. c.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "closeTheDialog"); c.getActionMap().put("closeTheDialog", new AbstractAction() { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent cancel) { b.doClick(); }); ... |
void | addEscListener(JComponent c, final JButton b) This method implements hotkey binding for [Esc] for currently focused JComponent with a "Cancel" Button. c.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "pressCancel"); c.getActionMap().put("pressCancel", new AbstractAction() { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent cancel) { b.doClick(); }); ... |
void | fillRow(int row, String labelDesc, JComponent[] boxes, JButton button, Container panel) fill Row fillRow(row, new JLabel(labelDesc), boxes, button, panel);
|