Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

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

public class Main {
    /**
     * Should be called before initComponents()
     *
     * @param lafName
     */
    public static void setLaf(String lafName) {
        for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
            if (info.getName().equals(lafName)) {
                try {
                    UIManager.setLookAndFeel(info.getClassName());
                } catch (ClassNotFoundException | InstantiationException | IllegalAccessException
                        | UnsupportedLookAndFeelException e) {
                }
                break;
            }
        }
    }
}