Java Swing UIManager setNimbusLF()

Here you can find the source of setNimbusLF()

Description

Sets look and feel to Nimbus.

License

Open Source License

Declaration

public static boolean setNimbusLF() 

Method Source Code

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

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

public class Main {
    /**/*from   w  ww  .ja va2  s . com*/
     * Sets look and feel to Nimbus.
     * 
     * @return
     */
    public static boolean setNimbusLF() {
        try {
            for (LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(laf.getName())) {
                    UIManager.setLookAndFeel(laf.getClassName());
                    break;
                }
            }
        } catch (Exception e) {
            // If Nimbus is not available, you can set the GUI to another look and feel.
            return false;
        }
        return true;
    }
}

Related

  1. setCrossPlatformProperties()
  2. setDefaultSize(int size)
  3. setEnabled(Component component, boolean enabled, boolean recursively)
  4. setNative()
  5. SetNetBeansCompatibleUIManager()
  6. setSwingProperties(String appName)
  7. setSystemUi()
  8. setTheme()
  9. setupComponent(JComponent comp)