Examples of PlasticLookAndFeel


Examples of com.jgoodies.looks.plastic.PlasticLookAndFeel

    LookAndFeel selectedLaf = null;
    if (Platform.isWindows()) {
      try {
        selectedLaf = (LookAndFeel) Class.forName("com.jgoodies.looks.windows.WindowsLookAndFeel").newInstance();
      } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
        selectedLaf = new PlasticLookAndFeel();
      }
    } else if (System.getProperty("nativelook") == null && !Platform.isMac()) {
      selectedLaf = new PlasticLookAndFeel();
    } else {
      try {
        String systemClassName = UIManager.getSystemLookAndFeelClassName();
        // Workaround for Gnome
        try {
          String gtkLAF = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel";
          Class.forName(gtkLAF);

          if (systemClassName.equals("javax.swing.plaf.metal.MetalLookAndFeel")) {
            systemClassName = gtkLAF;
          }
        } catch (ClassNotFoundException ce) {
          LOGGER.error("Error loading GTK look and feel: ", ce);
        }

        LOGGER.trace("Choosing Java look and feel: " + systemClassName);
        UIManager.setLookAndFeel(systemClassName);
      } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e1) {
        selectedLaf = new PlasticLookAndFeel();
        LOGGER.error("Error while setting native look and feel: ", e1);
      }
    }

    if (selectedLaf instanceof PlasticLookAndFeel) {
View Full Code Here

Examples of com.jgoodies.looks.plastic.PlasticLookAndFeel

    LookAndFeel selectedLaf = null;
    if (Platform.isWindows()) {
      try {
        selectedLaf = (LookAndFeel) Class.forName("com.jgoodies.looks.windows.WindowsLookAndFeel").newInstance();
      } catch (Exception e) {
        selectedLaf = new PlasticLookAndFeel();
      }
    } else if (System.getProperty("nativelook") == null && !Platform.isMac()) {
      selectedLaf = new PlasticLookAndFeel();
    } else {
      try {
        String systemClassName = UIManager.getSystemLookAndFeelClassName();
        // workaround for Gnome
        try {
          String gtkLAF = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel";
          Class.forName(gtkLAF);

          if (systemClassName.equals("javax.swing.plaf.metal.MetalLookAndFeel")) {
            systemClassName = gtkLAF;
          }
        } catch (ClassNotFoundException ce) {
          logger.error("Error loading GTK look and feel: ", ce);
        }

        logger.trace("Choosing Java look and feel: " + systemClassName);
        UIManager.setLookAndFeel(systemClassName);
      } catch (Exception e1) {
        selectedLaf = new PlasticLookAndFeel();
        logger.error("Error while setting native look and feel: ", e1);
      }
    }

    if (selectedLaf instanceof PlasticLookAndFeel) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.