Java Swing Look and Feel setLookAndFeel(String lafName)

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

Description

set Look And Feel

License

Apache License

Declaration

public static void setLookAndFeel(String lafName) throws ClassNotFoundException, InstantiationException,
            IllegalAccessException, UnsupportedLookAndFeelException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

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

public class Main {
    public static void setLookAndFeel(String lafName) throws ClassNotFoundException, InstantiationException,
            IllegalAccessException, UnsupportedLookAndFeelException {
        for (LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) {
            if (lafName.equals(laf.getName())) {
                UIManager.setLookAndFeel(laf.getClassName());
            }/*from w  ww.j av  a2s  .co  m*/
        }
    }
}

Related

  1. setLookAndFeel()
  2. setLookAndFeel(Component comp)
  3. setLookAndFeel(Component comp, LookAndFeel lf)
  4. setLookAndFeel(final Class lookAndFeel)
  5. setLookAndFeel(String laf)
  6. setLookAndFeel(String look)
  7. setLookAndFeel(String lookAndFeelClass)
  8. setLookAndFeelByName(final String lookAndFeel)
  9. setLookAndTheme(LookAndFeel laf, Object theme)