private static boolean isWindows(LookAndFeel laf) { if (laf.getID() == "Windows") { return true; } if (!checkedForWindows) { try { WINDOWS_CLASS = Class.forName("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); } catch (ClassNotFoundException e) { } checkedForWindows = true; } return (WINDOWS_CLASS != null && WINDOWS_CLASS.isInstance(laf)); }
private static boolean isKnownLookAndFeel() { LookAndFeel laf = UIManager.getLookAndFeel(); String lookAndFeelID = laf.getID(); return (lookAndFeelID == "GTK" || lookAndFeelID == "Aqua" || isMetal(laf) || isWindows(laf)); }
private static boolean isMetal(LookAndFeel laf) { return (laf.getID() == "Metal" || laf instanceof MetalLookAndFeel); }