Java Swing Look and Feel setSystemLookAndFeel()

Here you can find the source of setSystemLookAndFeel()

Description

Tries to set the LookAndFeel to the os default

License

Open Source License

Return

if the system look and feel could be set

Declaration

public static boolean setSystemLookAndFeel() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.*;

public class Main {
    /**//from   w  w  w  .j  ava  2 s. com
     * 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;
    }
}

Related

  1. setSystemLAF()
  2. setSystemLaF()
  3. setSystemLookAndFeel()
  4. setSystemLookAndFeel()
  5. setSystemLookAndFeel()
  6. setSystemLookAndFeel(Component c)
  7. setSystemLookAndFeel(Component comp, String lookAndFeelStr)
  8. setWindowsLook()
  9. setWindowsLookAndFeel()