Java Swing Look and Feel setSystemLookAndFeel(Component c)

Here you can find the source of setSystemLookAndFeel(Component c)

Description

Set the look and feel of the specified component to the style of the current system.

License

Open Source License

Parameter

Parameter Description
c the specified component

Declaration

public static void setSystemLookAndFeel(Component c) 

Method Source Code


//package com.java2s;
import java.awt.Component;

import javax.swing.SwingUtilities;
import javax.swing.UIManager;

public class Main {
    /**//ww  w  .  j a v a  2 s  . c  om
     * Set the look and feel of the specified component to the style of the
     * current system.
     * 
     * @param c
     *            the specified component
     */
    public static void setSystemLookAndFeel(Component c) {
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            SwingUtilities.updateComponentTreeUI(c);
            c.validate();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Related

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