Example usage for com.jgoodies.forms.util LayoutStyle setCurrent

List of usage examples for com.jgoodies.forms.util LayoutStyle setCurrent

Introduction

In this page you can find the example usage for com.jgoodies.forms.util LayoutStyle setCurrent.

Prototype

public static void setCurrent(LayoutStyle newLayoutStyle) 

Source Link

Document

Set a new LayoutStyle .

Usage

From source file:edu.udo.scaffoldhunter.gui.util.LookAndFeel.java

License:Open Source License

/**
 * Tries to set the closest thing we can get to a native look and feel.
 *//*  w w  w . j a  va2  s . c  o m*/
private static void configureNativeLookAndFeel() {
    try {
        String nativeLF = UIManager.getSystemLookAndFeelClassName();

        // on *nix desktops other than GNOME, Java reports its default
        // MetalLookAndFeel as the system look and feel. In most cases, the
        // user's GTK theme will look better and more 'native'.
        if (nativeLF.equals("javax.swing.plaf.metal.MetalLookAndFeel")) {
            nativeLF = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel";
        }

        UIManager.setLookAndFeel(nativeLF);
    } catch (Exception e) {
        // things will probably look ugly, but continue anyway
    }

    if (isGTKLookAndFeel()) {
        // fix the layout style for JGoodies components.
        // JGoodies itself only recognizes Mac and Windows styles, and
        // defaults to Windows
        LayoutStyle.setCurrent(GTKLayoutStyle.INSTANCE);
    }
}