List of utility methods to do Swing Look and Feel
void | applyNimbusLaF() apply Nimbus La F try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); UIManager.put("nimbusSelectionBackground", new Color(173, 207, 231)); } catch (Exception e) { e.printStackTrace(); |
String | applyStartupLookAndFeel(String desiredLafClassName) Try to apply the specified look and feel. try { String clsName = desiredLafClassName; UIManager.setLookAndFeel(clsName); return clsName; } catch (Exception e) { try { String clsName; ... |
void | checkGTKLookAndFeel() Look and feel improvement on Ubuntu http://stackoverflow.com/questions/3907047/how-to-change-the-default-font -size-in-the-swing-gtk-lookandfeel/31345102#31345102 final LookAndFeel look = UIManager.getLookAndFeel(); if (!look.getID().equals("GTK")) return; new JFrame(); new JButton(); new JComboBox<>(); new JRadioButton(); new JCheckBox(); ... |
boolean | checkThemeLiscense(LookAndFeelInfo i) A static method for blocking the Quaqua theme from working with any OS but OSX. String osName = System.getProperty("os.name").toLowerCase(); String suitableName = i.getName(); if (suitableName.startsWith("Quaqua") && !osName.startsWith("mac os x")) { return false; return true; |
boolean | computeIsLafAqua() Computes and answers whether an Aqua look&feel is active. return UIManager.getLookAndFeel().getID().equals("Aqua"); |
void | defaultLookAndFeel() default Look And Feel try { for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if (DEFAULT_LOOK_AND_FEEL.equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; } catch (Exception e) { ... |
void | enableLafIfAvailable(String lafName) Enables look and feel with specified name only if such LaF is available for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if (lafName.equals(info.getName())) { try { UIManager.setLookAndFeel(info.getClassName()); break; } catch (Exception e) { |
void | fixLnF() fix Ln F final Object osName = System.getProperties().get("os.name"); if (!osName.equals("Mac OS X")) { loadPlasticLnF(); |
LookAndFeelInfo[] | getAvailableLookAndFeels() get Available Look And Feels return Arrays.copyOf(availableLookAndFeels, availableLookAndFeels.length);
|
List | getAvailableLookAndFeels() Returns a list of available Swing Look and Feels ArrayList<String> availableLookAndFeels = new ArrayList<>(5); for (UIManager.LookAndFeelInfo lafInfo : UIManager.getInstalledLookAndFeels()) { availableLookAndFeels.add(lafInfo.getName()); return availableLookAndFeels; |