Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

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

public class Main {
    /**
     * 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();
        }
    }
}