Here you can find the source of setNimbusLookAndFeel()
public static boolean setNimbusLookAndFeel()
//package com.java2s; //License from project: Open Source License import javax.swing.*; public class Main { /**/*w w w. j av a 2s. c o m*/ * Tries to set the NimbusLookAndFeel * * @return if the NimbusLookAndFeel could bet set */ public static boolean setNimbusLookAndFeel() { boolean isNumbusSet = true; try { // Nimbus Loyout UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); } catch (ClassNotFoundException e) { isNumbusSet = false; } catch (InstantiationException e) { isNumbusSet = false; } catch (IllegalAccessException e) { isNumbusSet = false; } catch (UnsupportedLookAndFeelException e) { isNumbusSet = false; } return isNumbusSet; /* * try {//alternative way for (LookAndFeelInfo info : * UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { * UIManager.setLookAndFeel(info.getClassName()); break; } } } catch * (UnsupportedLookAndFeelException e) { } catch (ClassNotFoundException e) { } catch * (InstantiationException e) { } catch (IllegalAccessException e) { } */ } }