Java Swing Look and Feel setLaf(String lafName)

Here you can find the source of setLaf(String lafName)

Description

Should be called before initComponents()

License

Open Source License

Parameter

Parameter Description
lafName a parameter

Declaration

public static void setLaf(String lafName) 

Method Source Code

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

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

public class Main {
    /**/* w w w  .  j av  a 2  s .  com*/
     * Should be called before initComponents()
     *
     * @param lafName
     */
    public static void setLaf(String lafName) {
        for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
            if (info.getName().equals(lafName)) {
                try {
                    UIManager.setLookAndFeel(info.getClassName());
                } catch (ClassNotFoundException | InstantiationException | IllegalAccessException
                        | UnsupportedLookAndFeelException e) {
                }
                break;
            }
        }
    }
}

Related

  1. setJavaLookAndFeel()
  2. setLaf()
  3. setLAF(final String lafName)
  4. setLAF(String className)
  5. setLAF(String LAFName)
  6. setLAFNimbus()
  7. setLookAndFeel()
  8. setLookAndFeel()
  9. setLookAndFeel()