Here you can find the source of setBestLookAndFeelAvailable()
public static void setBestLookAndFeelAvailable()
//package com.java2s; /* Copyright 2009-2014 Edouard Garnier de Labareyre * * This file is part of B@ggle./*from www . ja v a2 s. co m*/ * * B@ggle is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * B@ggle is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with B@ggle. If not, see <http://www.gnu.org/licenses/>. */ import javax.swing.UIManager; public class Main { public static void setBestLookAndFeelAvailable() { String system_lf = UIManager.getSystemLookAndFeelClassName().toLowerCase(); if (system_lf.contains("metal")) { try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); } catch (Exception e) { } } else { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { } } } }