Package com.santiagolizardo.beobachter.beans

Examples of com.santiagolizardo.beobachter.beans.SwingLookAndFeel


  private static final long serialVersionUID = 3175998803653741072L;

  @Override
  public Component getListCellRendererComponent(JList<?> list, Object value,
      int index, boolean isSelected, boolean cellHasFocus) {
    SwingLookAndFeel lookAndFeel = (SwingLookAndFeel) value;
    return super.getListCellRendererComponent(list, lookAndFeel.getName(),
        index, isSelected, cellHasFocus);
  }
View Full Code Here


    LookAndFeelInfo[] infos = UIManager.getInstalledLookAndFeels();
    SwingLookAndFeel[] lafs = new SwingLookAndFeel[infos.length];
    for (int i = 0; i < infos.length; i++) {
      LookAndFeelInfo info = infos[i];
      lafs[i] = new SwingLookAndFeel(info.getName(), info.getClassName());
    }
    lookAndFeelComboBox = new JComboBox<>(lafs);
    lookAndFeelComboBox.setRenderer(new SwingLAFRenderer());
    try {
      SwingLookAndFeel look = SwingLookAndFeel.forName(configManager
          .getWindowLAF());
      lookAndFeelComboBox.setSelectedItem(look);
    } catch (Exception e) {
      logger.warning("Unable to set the selected look&feel.");
    }

    String[] languages = LocaleUtil.getAvailableLocales();

    languageComboBox = new JComboBox<>(languages);
    languageComboBox.setSelectedItem(configManager.getLanguage());
    languageComboBox.setRenderer(new LocaleRender());

    okButton = new JButton(Translator.tr("Save"));
    okButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent event) {
        setVisible(false);

        SwingLookAndFeel laf = ((SwingLookAndFeel) lookAndFeelComboBox
            .getSelectedItem());
        configManager.setWindowLAF(laf.getClassName());
        SwingUtil.setLookAndFeel(laf.getClassName());
        SwingUtilities.updateComponentTreeUI(mainWindow);

        Object selectedLanguage = languageComboBox.getSelectedItem();
        if (null != selectedLanguage) {
          configManager.setLanguage(selectedLanguage.toString());
View Full Code Here

TOP

Related Classes of com.santiagolizardo.beobachter.beans.SwingLookAndFeel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.