Java Swing Look and Feel setSystemLAF()

Here you can find the source of setSystemLAF()

Description

Sets the system look and feel.

License

Open Source License

Declaration

public static boolean setSystemLAF() 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2009-2014 Black Rook Software
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v2.1
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
 ******************************************************************************/

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

public class Main {
    /**//from  w w w .  j a  v a 2 s  . c  o m
     * Sets the system look and feel.
     * If this is not possible, this returns false. 
     * Otherwise, this sets the system look and feel and returns true.
     */
    public static boolean setSystemLAF() {
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (ClassNotFoundException e) {
            return false;
        } catch (InstantiationException e) {
            return false;
        } catch (IllegalAccessException e) {
            return false;
        } catch (UnsupportedLookAndFeelException e) {
            return false;
        }
        return true;
    }
}

Related

  1. setNiceSwingLookAndFeel()
  2. setNimbusLookAndFeel()
  3. setNimbusLookAndFeel()
  4. setSOMToolboxLookAndFeel()
  5. setSystemLAF()
  6. setSystemLaF()
  7. setSystemLookAndFeel()
  8. setSystemLookAndFeel()
  9. setSystemLookAndFeel()