Java Swing Look and Feel setLookAndFeel()

Here you can find the source of setLookAndFeel()

Description

set Look And Feel

License

Open Source License

Declaration

public static void setLookAndFeel() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.UIManager;

public class Main {
    public static void setLookAndFeel() {
        String lafStr = System.getProperty("anidev.pcds.laf", "<nimbus>");
        switch (lafStr) {
        case "<nimbus>":
            lafStr = "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel";
            break;
        case "<system>":
            lafStr = UIManager.getSystemLookAndFeelClassName();
            break;
        case "<cross>":
            lafStr = UIManager.getCrossPlatformLookAndFeelClassName();
            break;
        }//from w  w w .  ja v  a 2 s  . c  om
        try {
            UIManager.setLookAndFeel(lafStr);
        } catch (Exception e) {
            System.err.println("Error while setting " + lafStr + " L&F.");
            e.printStackTrace();
        }
    }
}

Related

  1. setLookAndFeel()
  2. setLookAndFeel()
  3. setLookandFeel()
  4. setLookAndFeel()
  5. setLookAndFeel()
  6. setLookAndFeel()
  7. setLookAndFeel(Component comp)
  8. setLookAndFeel(Component comp, LookAndFeel lf)
  9. setLookAndFeel(final Class lookAndFeel)