/** * Returns whether the Nimbus Look and Feel is installed. * * @return Whether the current LAF is Nimbus. */ private static boolean isNimbusLookAndFeel() { return UIManager.getLookAndFeel().getName().equals("Nimbus"); }
private static boolean isUnderDarcula() { return UIManager.getLookAndFeel().getName().contains("Darcula"); } }
@Override public void updateUI() { if ("Nimbus".equals(UIManager.getLookAndFeel().getName())) { UIDefaults map = new UIDefaults(); Painter painter = new Painter() { final Color color = null; @Override public void paint(Graphics2D g, Object c, int w, int h) { g.setColor(color == null ? UIManager.getDefaults().getColor("desktop") : color); g.fillRect(0,0,w,h); } }; map.put("DesktopPane[Enabled].backgroundPainter", painter); putClientProperty("Nimbus.Overrides", map); } super.updateUI(); } }
String current = UIManager.getLookAndFeel().getName(); combo.setSelectedItem(current); combo.addActionListener(new ActionListener() {
/** * Returns whether the Nimbus Look and Feel is installed. * * @return Whether the current LAF is Nimbus. */ private static boolean isNimbusLookAndFeel() { return UIManager.getLookAndFeel().getName().equals("Nimbus"); }
/** * Hack around Nimbus not respecting background colors if UIResource. * So by-pass ... * * @return */ private boolean isNimbus() { return UIManager.getLookAndFeel().getName().contains("Nimbus"); }
/** * Hack around Nimbus not respecting background colors if UIResource. * So by-pass ... * * @return */ private boolean isNimbus() { return UIManager.getLookAndFeel().getName().contains("Nimbus"); }
/** * Computes and answers whether the Aqua look&feel is active. * * @return true if the current look&feel is Aqua */ private static boolean computeIsLafAqua() { LookAndFeel laf = UIManager.getLookAndFeel(); return laf.getName().startsWith("Mac OS X Aqua"); }
/** * Hack around Nimbus not respecting background colors if UIResource. * So by-pass ... * * @return */ private boolean isNimbus() { return UIManager.getLookAndFeel().getName().contains("Nimbus"); }
/** * Hack around Nimbus not respecting background colors if UIResource. * So by-pass ... * * @return */ private boolean isNimbus() { return UIManager.getLookAndFeel().getName().contains("Nimbus"); }
/** * Hack around Nimbus not respecting background colors if UIResource. * So by-pass ... * * @return */ private boolean isNimbus() { return UIManager.getLookAndFeel().getName().contains("Nimbus"); }
/** * Returns whether the Nimbus Look and Feel is installed. * * @return Whether the current LAF is Nimbus. */ private static boolean isNimbusLookAndFeel() { return UIManager.getLookAndFeel().getName().equals("Nimbus"); }
/** * Hack around Nimbus not respecting background colors if UIResource. * So by-pass ... * * @return */ private boolean isNimbus() { return UIManager.getLookAndFeel().getName().contains("Nimbus"); }
/** * Hack around Nimbus not respecting background colors if UIResource. * So by-pass ... * * @return */ private boolean isNimbus() { return UIManager.getLookAndFeel().getName().contains("Nimbus"); }
public static Dimension getBigIconToogleButtonSize() { String look = UIManager.getLookAndFeel().getName(); if ("Mac OS X Aqua".equalsIgnoreCase(look) || look.startsWith("GTK")) { //$NON-NLS-1$ //$NON-NLS-2$ return new Dimension(36, 36); } else { return new Dimension(30, 30); } }
public static Dimension getSmallIconButtonSize() { String look = UIManager.getLookAndFeel().getName(); if ("CDE/Motif".equalsIgnoreCase(look)) { //$NON-NLS-1$ return new Dimension(38, 34); } else if (look.startsWith("GTK")) { //$NON-NLS-1$ return new Dimension(28, 28); } else { return new Dimension(22, 22); } }
public TrimmedButton(String title, int trim) { super(title); if (trim>0) { LookAndFeel laf = UIManager.getLookAndFeel(); String name = laf!=null?laf.getName():""; if (ij.IJ.isMacOSX() && name!=null && !name.equals("Mac OS X")) trim = 0; } this.trim = trim; }
try { LookAndFeel laf = UIManager.getLookAndFeel(); for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { ... if (laf.getName().equals(info.getName())) { ...; } } } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { Logger.getLogger(NewJFrame1.class.getName()).log(Level.SEVERE, null, ex); }
private void setLookAndFeelProperties() { // Fill the content area under the Windows L&F only, required for the borders to be painted. // Note: filing the content area under Metal L&F looks like absolute crap. setContentAreaFilled(OsFamily.WINDOWS.isCurrent() && "Windows".equals(UIManager.getLookAndFeel().getName())); }
public static void installLookAndFeel(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException { LookAndFeel plaf; plaf = (LookAndFeel)Class.forName(className, true, ExtensionManager.getClassLoader()).newInstance(); if(plaf.isSupportedLookAndFeel()) UIManager.installLookAndFeel(plaf.getName(), plaf.getClass().getName()); }