Java Swing Look and Feel tryToSetSystemLookAndFeel()

Here you can find the source of tryToSetSystemLookAndFeel()

Description

try To Set System Look And Feel

License

Mozilla Public License

Declaration

public static void tryToSetSystemLookAndFeel() 

Method Source Code

//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) {
        }
    }
}

Related

  1. setWindowsLook()
  2. setWindowsLookAndFeel()
  3. setWindowsLookLike(Window window)
  4. supportsDarkLookAndFeel()
  5. trySetNimbusLookAndFeel()
  6. tweakLookAndFeel()
  7. useCrossPlatformLookAndFeel(Component object)
  8. usingAppleLAF()