Here you can find the source of setCoolLookAndFeel()
public static boolean setCoolLookAndFeel()
//package com.java2s; //License from project: Open Source License import javax.swing.*; public class Main { /**//w w w.java2 s. com * Tries to set the NimbusLookAndFeel or (if Nibus is not available) the OS like * LookAndFeel * * @return true if the LookAndFeel could be changed */ public static boolean setCoolLookAndFeel() { return (setNimbusLookAndFeel() || setSystemLookAndFeel()); } /** * 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) { } */ } /** * Tries to set the LookAndFeel to the os default * * @return if the system look and feel could be set */ public static boolean setSystemLookAndFeel() { boolean isSystemLookAndFeelSet = true; try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { isSystemLookAndFeelSet = false; } return isSystemLookAndFeelSet; } }