use of com.jgoodies.looks.windows.WindowsLookAndFeel in project SIMRacingApps by SIMRacingApps.
the class MainFrame method createInstance.
public static void createInstance() {
try {
Toolkit.getDefaultToolkit().setDynamicLayout(true);
System.setProperty("sun.awt.noerasebackground", "true");
// JGoodies
// menu icons
Options.setDefaultIconSize(new Dimension(16, 16));
Options.setUseNarrowButtons(false);
Options.setPopupDropShadowEnabled(true);
UIManager.setLookAndFeel(System.getProperty("os.name").toLowerCase().startsWith("windows") ? new WindowsLookAndFeel() : new PlasticXPLookAndFeel());
_instance = new MainFrame();
} catch (Exception e) {
System.err.println(e);
}
}
use of com.jgoodies.looks.windows.WindowsLookAndFeel in project beast-mcmc by beast-dev.
the class MainFrame method createInstance.
public static void createInstance() {
try {
Toolkit.getDefaultToolkit().setDynamicLayout(true);
System.setProperty("sun.awt.noerasebackground", "true");
// JGoodies
// menu icons
Options.setDefaultIconSize(new Dimension(16, 16));
Options.setUseNarrowButtons(false);
Options.setPopupDropShadowEnabled(true);
UIManager.setLookAndFeel(System.getProperty("os.name").toLowerCase().startsWith("windows") ? new WindowsLookAndFeel() : new PlasticXPLookAndFeel());
_instance = new MainFrame();
} catch (Exception e) {
System.err.println(e);
}
}
use of com.jgoodies.looks.windows.WindowsLookAndFeel in project UniversalMediaServer by UniversalMediaServer.
the class LooksFrame method initializeLookAndFeel.
public static void initializeLookAndFeel() {
synchronized (lookAndFeelInitializedLock) {
if (lookAndFeelInitialized) {
return;
}
LookAndFeel selectedLaf = null;
if (Platform.isWindows()) {
selectedLaf = new WindowsLookAndFeel();
} 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) {
PlasticLookAndFeel.setPlasticTheme(PlasticLookAndFeel.createMyDefaultTheme());
PlasticLookAndFeel.setTabStyle(PlasticLookAndFeel.TAB_STYLE_DEFAULT_VALUE);
PlasticLookAndFeel.setHighContrastFocusColorsEnabled(false);
} else if (selectedLaf != null && selectedLaf.getClass() == MetalLookAndFeel.class) {
MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
}
// Work around caching in MetalRadioButtonUI
JRadioButton radio = new JRadioButton();
radio.getUI().uninstallUI(radio);
JCheckBox checkBox = new JCheckBox();
checkBox.getUI().uninstallUI(checkBox);
if (selectedLaf != null) {
try {
UIManager.setLookAndFeel(selectedLaf);
// https://bugs.openjdk.java.net/browse/JDK-8179014
if (selectedLaf instanceof WindowsLookAndFeel) {
UIManager.put("FileChooser.useSystemExtensionHiding", false);
}
} catch (UnsupportedLookAndFeelException e) {
LOGGER.warn("Can't change look and feel", e);
}
}
lookAndFeelInitialized = true;
}
}
Aggregations