List of utility methods to do Swing Look and Feel
void | setLookAndFeel(Component comp, LookAndFeel lf) set Look And Feel try { UIManager.setLookAndFeel(lf); SwingUtilities.updateComponentTreeUI(comp); } catch (Exception e) { e.printStackTrace(System.err); |
void | setLookAndFeel(final Class> lookAndFeel) Sets the entire L&F based on "simple" name. if (lookAndFeel == null) { setLookAndFeelByName(null); } else { setLookAndFeelByName(lookAndFeel.getName()); |
void | setLookAndFeel(String laf) set Look And Feel try { UIManager.setLookAndFeel(laf); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) { e.printStackTrace(); |
void | setLookAndFeel(String lafName) set Look And Feel for (LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) { if (lafName.equals(laf.getName())) { UIManager.setLookAndFeel(laf.getClassName()); |
void | setLookAndFeel(String look) Sets look and feel. try { UIManager.setLookAndFeel(look); } catch (ClassNotFoundException e) { throw new IllegalArgumentException("Class " + look + " is not found", e); } catch (InstantiationException e) { throw new IllegalArgumentException("Instantiation problem when setting look and feel", e); } catch (IllegalAccessException e) { throw new IllegalArgumentException("Security problem when setting look and feel", e); ... |
boolean | setLookAndFeel(String lookAndFeelClass) set Look And Feel try { UIManager.setLookAndFeel(lookAndFeelClass); return true; } catch (Throwable t) { System.err.println(t.getMessage()); return false; |
void | setLookAndFeelByName(final String lookAndFeel) Sets the entire L&F based on "simple" name. if (lookAndFeel == null) { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { e.printStackTrace(); return; String specified = lookAndFeel.toLowerCase(Locale.US).trim(); String current = UIManager.getLookAndFeel().getName().toLowerCase(Locale.US); if (!specified.equals(current)) { try { for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { String name = info.getName().toLowerCase(Locale.US); String className = info.getClassName().toLowerCase(Locale.US); if (specified.equals(name) || specified.equals(className)) { UIManager.setLookAndFeel(info.getClassName()); return; } catch (Exception e) { e.printStackTrace(); new Exception("Could not load " + lookAndFeel + ", it was not available.").printStackTrace(); |
void | setLookAndTheme(LookAndFeel laf, Object theme) set Look And Theme UIManager.setLookAndFeel(laf); |
void | setMetalLAF() Attempts to set the default look-and-feel to Metal. setLAF(METAL_LAF_CLASS); |
void | setMotifLookAndFeel() set Motif Look And Feel try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel"); } catch (Exception e) { System.out.println("Error setting Motif LAF: " + e); |