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) {