Here you can find the source of tryToSetSystemLookAndFeel()
public static void tryToSetSystemLookAndFeel()
//package com.java2s; /***************************************************************************************** * *** BEGIN LICENSE BLOCK *****/* www . ja v a2 s .com*/ * * Version: MPL 2.0 * * echocat Jomon, Copyright (c) 2012-2013 echocat * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * *** END LICENSE BLOCK ***** ****************************************************************************************/ import static javax.swing.UIManager.getSystemLookAndFeelClassName; import static javax.swing.UIManager.setLookAndFeel; public class Main { public static void tryToSetSystemLookAndFeel() { try { setLookAndFeel(getSystemLookAndFeelClassName()); } catch (final Exception ignored) { } } }