List of utility methods to do Swing Look and Feel
boolean | matchLnf(LookAndFeel lookAndFeel, UIManager.LookAndFeelInfo lookAndFeelInfo) Do the supplied l&f object and l&f info object refer to the same l&f? return lookAndFeel.getClass().getName().equals(lookAndFeelInfo.getClassName());
|
void | metalLookAndFeel() metal Look And Feel try { UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); } catch (ClassNotFoundException e) { throw new UnsupportedOperationException("Fix This"); } catch (InstantiationException e) { throw new UnsupportedOperationException("Fix This"); } catch (IllegalAccessException e) { throw new UnsupportedOperationException("Fix This"); ... |
boolean | nativeLook() native Look try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); return true; } catch (Exception ex) { return false; |
void | printInstalledLookAndFeel() Prints the installed look and feel. final LookAndFeelInfo[] look = UIManager.getInstalledLookAndFeels(); for (final LookAndFeelInfo lookAndFeelInfo : look) { System.out.println(lookAndFeelInfo.getClassName()); |
void | printInstalledPLAFs() print Installed PLA Fs UIManager.LookAndFeelInfo plaf[] = UIManager.getInstalledLookAndFeels(); for (int i = 0, n = plaf.length; i < n; i++) { System.out.println("Name: " + plaf[i].getName()); System.out.println(" Class name: " + plaf[i].getClassName()); |
void | setBestLookAndFeelAvailable() set Best Look And Feel Available String system_lf = UIManager.getSystemLookAndFeelClassName().toLowerCase(); if (system_lf.contains("metal")) { try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); } catch (Exception e) { } else { try { ... |
boolean | setCoolLookAndFeel() Tries to set the NimbusLookAndFeel or (if Nibus is not available) the OS like LookAndFeel return (setNimbusLookAndFeel() || setSystemLookAndFeel());
|
void | setDefaultLookAndFeel() Set the system default look and feel. try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { |
void | setDefaultLookandfeel() Calls UIManager#setLookAndFeel(javax.swing.LookAndFeel) with UIManager#getSystemLookAndFeelClassName() try { setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { e.printStackTrace(); |
void | setJavaLookAndFeel() set Java Look And Feel try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } catch (Exception e) { System.out.println("Error setting Java LAF: " + e); |