List of utility methods to do JButton Key Event
void | addFastKeys(JButton[] buttonList) add Fast Keys for (JButton button : buttonList) { button.setMnemonic(button.getText().charAt(button.getText().indexOf('&') + 1)); button.setText(button.getText().replace("&", "")); |
JButton | makeJButton(ResourceBundle resource, String panelName, String keyword, Icon icon, ActionListener listener) Factory Method to create Button using specified params String label; try { label = resource.getString(panelName + "_BUTTON_" + keyword + "_LABEL"); } catch (MissingResourceException e) { label = "Missing Label"; JButton button = new JButton(); if (label != null) ... |
void | setButtonKeyStroke(final JButton button, KeyStroke keyStroke) set Button Key Stroke Action action = new AbstractAction() { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { if (button != null) { button.doClick(); }; setKeyStroke(button, keyStroke, action); |