private JButton getAddButton() { if (addButton == null) { addButton = new JButton("Add"); addButton.setDisplayedMnemonicIndex(2); addButton.addActionListener(eventHandler); } return addButton; }
private JButton getRemoveButton() { if (removeButton == null) { removeButton = new JButton("Remove"); removeButton.setDisplayedMnemonicIndex(3); removeButton.addActionListener(eventHandler); } return removeButton; }
private JButton getAddAllButton() { if (addAllButton == null) { addAllButton = new JButton(); addAllButton.setText("Add All ->"); addAllButton.setMnemonic('l'); addAllButton.setDisplayedMnemonicIndex(5); addAllButton.addActionListener(eventHandler); } return addAllButton; }
private JButton getRemoveButton() { if (removeButton == null) { removeButton = new JButton(); removeButton.setText("<- Remove"); removeButton.setMnemonic('m'); removeButton.setDisplayedMnemonicIndex(5); removeButton.addActionListener(eventHandler); } return removeButton; }
public JButton getReplaceAllButton() { if (replaceAllButton == null) { replaceAllButton = new JButton(); replaceAllButton.setText("Replace All"); replaceAllButton.setMnemonic('A'); replaceAllButton.setDisplayedMnemonicIndex(8); replaceAllButton.addActionListener(this); } return replaceAllButton; }
private JButton addAction(JPanel actions, Action action) { JButton result = new JButton(action); actions.add(result); result.setEnabled(false); result.setDisplayedMnemonicIndex(result.getText().length() - 2); return result; }
private JButton getEnableAllSoundsButton() { if (enableAllSoundsButton == null) { enableAllSoundsButton = new JButton("Enable all"); enableAllSoundsButton.setMnemonic('a'); enableAllSoundsButton.setDisplayedMnemonicIndex(7); enableAllSoundsButton.addActionListener(eventHandler); } return enableAllSoundsButton; }
private JButton getDisableAllSoundsButton() { if (disableAllSoundsButton == null) { disableAllSoundsButton = new JButton("Disable all"); disableAllSoundsButton.setMnemonic('i'); disableAllSoundsButton.setDisplayedMnemonicIndex(1); disableAllSoundsButton.addActionListener(eventHandler); } return disableAllSoundsButton; }
private JButton getMixerDefaultButton() { if (mixerDefaultButton == null) { mixerDefaultButton = new JButton("Default"); mixerDefaultButton.setMnemonic('u'); mixerDefaultButton.setDisplayedMnemonicIndex(4); mixerDefaultButton.addActionListener(eventHandler); } return mixerDefaultButton; }
private JButton getPredefinedPlatformDefaultButton() { if (predefinedPlaformDefaultButton == null) { predefinedPlaformDefaultButton = new JButton("Default"); predefinedPlaformDefaultButton.setMnemonic('u'); predefinedPlaformDefaultButton.setDisplayedMnemonicIndex(4); predefinedPlaformDefaultButton.addActionListener(eventHandler); } return predefinedPlaformDefaultButton; }
private JButton getPredefinedSpeedButton() { if (predefinedSpeedButton == null) { predefinedSpeedButton = new JButton("Speed"); predefinedSpeedButton.setMnemonic('p'); predefinedSpeedButton.setDisplayedMnemonicIndex(1); predefinedSpeedButton.addActionListener(eventHandler); } return predefinedSpeedButton; }
private JButton getEnableAllViewOptionsButton() { if (enableAllViewOptionsButton == null) { enableAllViewOptionsButton = new JButton("Enable all"); enableAllViewOptionsButton.setMnemonic('a'); enableAllViewOptionsButton.setDisplayedMnemonicIndex(7); enableAllViewOptionsButton.addActionListener(eventHandler); } return enableAllViewOptionsButton; }
public JButton getCloseButton() { if (closeButton == null) { closeButton = new JButton(); closeButton.setText("Close"); closeButton.setMnemonic('l'); closeButton.setDisplayedMnemonicIndex(1); closeButton.addActionListener(this); } return closeButton; }
private JButton getDefaultViewOptionsButton() { if (defaultViewOptionsButton == null) { defaultViewOptionsButton = new JButton("Defaults"); defaultViewOptionsButton.setMnemonic('u'); defaultViewOptionsButton.setDisplayedMnemonicIndex(4); defaultViewOptionsButton.addActionListener(eventHandler); } return defaultViewOptionsButton; }
private JButton getDisableAllViewOptionsButton() { if (disableAllViewOptionsButton == null) { disableAllViewOptionsButton = new JButton("Disable all"); disableAllViewOptionsButton.setMnemonic('i'); disableAllViewOptionsButton.setDisplayedMnemonicIndex(1); disableAllViewOptionsButton.addActionListener(eventHandler); } return disableAllViewOptionsButton; }
private JButton getRemoveAllButton() { if (removeAllButton == null) { removeAllButton = new JButton(); removeAllButton.setText("<- Remove All"); removeAllButton.setMnemonic('v'); removeAllButton.setDisplayedMnemonicIndex(7); removeAllButton.addActionListener(eventHandler); } return removeAllButton; }
/** * Sets the mnemonic index for the open the file chooser dialog button. * <p> * <h2>AWT Thread</h2> * <p> * Should be called in the AWT thread. * * @param index * the mnemonic index. */ public void setButtonMnemonicIndex(int index) { this.buttonMnemonicIndex = index; getOpenFileChooser().setDisplayedMnemonicIndex(index); }
/** * Return the restartButton * * @return JButton */ private JButton getRestartButton() { if (restartButton == null) { restartButton = new JButton("Restart"); restartButton.setMnemonic('t'); restartButton.setDisplayedMnemonicIndex(3); restartButton.setHorizontalTextPosition(SwingConstants.CENTER); restartButton.setVerticalTextPosition(SwingConstants.BOTTOM); restartButton.addActionListener(eventHandler); restartButton.setEnabled(false); } return restartButton; }
private static void addButton(JFrame frame, String s) { AnnotatedString as = new AnnotatedString(s); JButton button = new JButton(as.toString()); button.setMnemonic(as.getMnemonic()); button.setDisplayedMnemonicIndex(as.getMnemonicIndex()); frame.getContentPane().add(button); System.out.println("\"" + s + "\" \"" + as + "\" '" + as.getMnemonic() + "' " + as.getMnemonicIndex()); }
public void setFinishButtonTextAndMnemonic(String text, char mnemonic, int mnemonicIndex) { getFinishButton().setText(text); getFinishButton().setMnemonic(mnemonic); getFinishButton().setDisplayedMnemonicIndex(mnemonicIndex); }