Here you can find the source of setLAF(final String lafName)
Parameter | Description |
---|---|
name | name of the look and feel to be loaded |
public static boolean setLAF(final String lafName)
//package com.java2s; //License from project: Apache License import javax.swing.UIManager; import javax.swing.UIManager.LookAndFeelInfo; public class Main { /**/*from w w w . j a v a 2 s. c o m*/ * Tries to set the specified Look and Feel. * @param name name of the look and feel to be loaded * @return true if the LAF was set successfully, false otherwise */ public static boolean setLAF(final String lafName) { for (final LookAndFeelInfo lookAndFeelInfo : UIManager.getInstalledLookAndFeels()) if (lookAndFeelInfo.getName().equals(lafName)) try { UIManager.setLookAndFeel(lookAndFeelInfo.getClassName()); return true; } catch (final Exception e) { System.err.println("Failed to set " + lookAndFeelInfo.getName() + " look and feel!"); e.printStackTrace(System.err); return false; } System.err.println(lafName + " look and feel was not found!"); return false; } }