Ejemplo n.º 1
0
  /** Creates a JRadioButtonMenuItem for the Look and Feel menu */
  private JMenuItem createLafMenuItem(
      JMenu menu, String label, char mnemonic, String accessibleDescription, String laf) {
    JMenuItem mi = (JRadioButtonMenuItem) menu.add(new JRadioButtonMenuItem(label));
    lafMenuGroup.add(mi);
    mi.setMnemonic(mnemonic);
    mi.getAccessibleContext().setAccessibleDescription(accessibleDescription);
    mi.addActionListener(new ChangeLookAndFeelAction(this, laf));
    mi.setEnabled(isAvailableLookAndFeel(laf));

    return mi;
  }
Ejemplo n.º 2
0
  /** Creates a JRadioButtonMenuItem for the Themes menu */
  private JMenuItem createThemesMenuItem(
      JMenu menu,
      String label,
      char mnemonic,
      String accessibleDescription,
      DefaultMetalTheme theme) {
    JRadioButtonMenuItem mi = (JRadioButtonMenuItem) menu.add(new JRadioButtonMenuItem(label));
    themesMenuGroup.add(mi);
    mi.setMnemonic(mnemonic);
    mi.getAccessibleContext().setAccessibleDescription(accessibleDescription);
    mi.addActionListener(new ChangeThemeAction(this, theme));

    return mi;
  }