예제 #1
0
    public TabGeneral() {
      looksCombo = new JComboBox<>(AppUIManager.getLookNames());
      looksCombo.setSelectedItem(UIManager.getLookAndFeel().getName());
      looksCombo.addActionListener(
          new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
              JComboBox<String> cb = (JComboBox<String>) e.getSource();
              String themeName = (String) cb.getSelectedItem();
              String themeClass = AppUIManager.getLookClass(themeName);

              settings.put(SettingsManager.UI_THEME, themeClass);

              // throws NPE when weblaf is chosen
              // hint the user instead to restart the app
              // AppUIManager.setLook(themeClass);
            }
          });

      add(new JLabel(StringConstants.LABEL_THEME));
      add(looksCombo);
    }
예제 #2
0
 private static void saveSettings() {
   settings.put(
       SettingsManager.UI_THEME, AppUIManager.getLookClass((String) looksCombo.getSelectedItem()));
   settings.saveSettings();
 }