Example usage for javax.swing UIManager getSystemLookAndFeelClassName

List of usage examples for javax.swing UIManager getSystemLookAndFeelClassName

Introduction

In this page you can find the example usage for javax.swing UIManager getSystemLookAndFeelClassName.

Prototype

public static String getSystemLookAndFeelClassName() 

Source Link

Document

Returns the name of the LookAndFeel class that implements the native system look and feel if there is one, otherwise the name of the default cross platform LookAndFeel class.

Usage

From source file:wjhk.jupload2.policies.DefaultUploadPolicy.java

/**
 * @param lookAndFeel/* w w w  .  j  a v  a2 s  .c  om*/
 *            the lookAndFeel to set
 */
protected void setLookAndFeel(String lookAndFeel) {
    try {
        this.lookAndFeel = lookAndFeel;
        if (lookAndFeel != null && !lookAndFeel.equals("") && !lookAndFeel.equals("java")) {
            // We try to call the UIManager.setLookAndFeel() method. We
            // catch
            // all possible exceptions, to prevent
            // that the applet is blocked.
            if (!lookAndFeel.equals("system")) {
                // Correction given by Fritz. Thanks to him.
                UIManager.setLookAndFeel(lookAndFeel);
            } else {
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            }
        } else {
            this.lookAndFeel = "java";
            UIManager.setLookAndFeel(new javax.swing.plaf.metal.MetalLookAndFeel());
        }
    } catch (Exception e) {
        displayErr(e);
        try {
            this.lookAndFeel = "java";
            UIManager.setLookAndFeel(new javax.swing.plaf.metal.MetalLookAndFeel());
        } catch (UnsupportedLookAndFeelException e1) {
            displayErr(e1);
            // Hum, hum: we should not arrive here... We not a 'dummy' one.
            this.lookAndFeel = null;
        }
    }
}

From source file:yadrone.DroneGUI.java

/**
 * Constructor//from   w  w  w  .j av  a 2 s  . c  o  m
 *
 * @param drone Drone object
 * @param pil Image panel with processed image stream
 * @param cont DroneControl object for receiving navigation data
 * @param regulator Object for reading and setting PID parameters
 * @param cd Object for reading and setting thresholding parameters
 */
public DroneGUI(IARDrone drone, DroneControl cont, ProcessedImagePanel pil, TimerTask regulator,
        CircleDetection cd, int[] resolution) {
    this.drone = drone;
    this.cont = cont;
    this.pil = pil;
    this.regulator = (Regulator) regulator;
    this.cd = cd;
    v1 = new VideoListener(drone, resolution);
    navData = new NavDataListener(drone);
    try {
        for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
            if ("Nimbus".equals(info.getName())) {
                UIManager.setLookAndFeel(info.getClassName());
                break;
            }
        }
    } catch (Exception e) {
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception ex) {
        }

    }
    df.setRoundingMode(RoundingMode.CEILING);
    initComponents();
    updateTextFields();
    this.setVisible(true);
}

From source file:yp.tibco.com.yang.lottery.client.GraphicalLotteryClient.java

/**
 * @param args the command line arguments
 *//*from w  ww.  java2s  .c o m*/
public static void main(String args[]) {
    try {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (Exception e) {
        // ignore
    }
    java.awt.EventQueue.invokeLater(new Runnable() {
        public void run() {
            new GraphicalLotteryClient().setVisible(true);
        }
    });
}