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:Main.java

public static void main(String[] argv) throws Exception {
    String nativeLF = UIManager.getSystemLookAndFeelClassName();

    // Install the look and feel
    UIManager.setLookAndFeel(nativeLF);

}

From source file:Main.java

public static void main(String[] args) {
    JFrame frame = new JFrame();
    frame.setSize(300, 300);/*ww  w . j ava2 s  . co  m*/
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setTitle("System LAF Demo");

    try {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    } catch (InstantiationException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (UnsupportedLookAndFeelException e) {
        e.printStackTrace();
    }

    SwingUtilities.updateComponentTreeUI(frame);

    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] args) {
    System.out.println("  " + UIManager.getLookAndFeel().getName());

    UIManager.LookAndFeelInfo[] inst = UIManager.getInstalledLookAndFeels();
    for (int i = 0; i < inst.length; i++) {
        System.out.println("  " + inst[i].getName());
    }// w  w w .ja va2s .  c o  m

    LookAndFeel[] aux = UIManager.getAuxiliaryLookAndFeels();
    if (aux != null) {
        for (int i = 0; i < aux.length; i++) {
            System.out.println("  " + aux[i].getName());
        }
    } else {
        System.out.println("  <NONE>");
    }
    System.out.println("  " + UIManager.getCrossPlatformLookAndFeelClassName());
    System.out.println("  " + UIManager.getSystemLookAndFeelClassName());
}

From source file:medical.Medical.java

/**
 * @param args the command line arguments
 *///from   w  w  w.  j  a v a2s  .  c  o m

public static void main(String[] args) throws IOException, ClientProtocolException, JSONException {
    // TODO code application logic here

    try {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (UnsupportedLookAndFeelException ex) {
        Logger.getLogger(Medical.class.getName()).log(Level.SEVERE, null, ex);
    } catch (ClassNotFoundException ex) {
        Logger.getLogger(Medical.class.getName()).log(Level.SEVERE, null, ex);
    } catch (InstantiationException ex) {
        Logger.getLogger(Medical.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IllegalAccessException ex) {
        Logger.getLogger(Medical.class.getName()).log(Level.SEVERE, null, ex);
    }
    FrameCita cita = new FrameCita();
    cita.setVisible(true);
}

From source file:net.freedom.gj.example.Main.java

public static void main(String[] args) {
    try {/*w  w  w.j ava  2  s.co  m*/
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (Exception ex) {
        Logger.getLogger(EmployeeView.class.getName()).log(Level.SEVERE, null, ex);
    }
    System.out.println("Welcome to EL entity mapper demonstration.\n");

    AbstractApplicationContext ctx = new ClassPathXmlApplicationContext(
            new String[] { "net/freedom/gj/example/mapping/mapping-configuration.xml" });

    ctx.registerShutdownHook();

}

From source file:UIManagerDefaults.java

public static void main(String[] args) {
    System.out.println("Default L&F:");
    System.out.println("  " + UIManager.getLookAndFeel().getName());

    UIManager.LookAndFeelInfo[] inst = UIManager.getInstalledLookAndFeels();
    System.out.println("Installed L&Fs: ");
    for (int i = 0; i < inst.length; i++) {
        System.out.println("  " + inst[i].getName());
    }//from  ww w .  ja  va2  s  . co m

    LookAndFeel[] aux = UIManager.getAuxiliaryLookAndFeels();
    System.out.println("Auxiliary L&Fs: ");
    if (aux != null) {
        for (int i = 0; i < aux.length; i++) {
            System.out.println("  " + aux[i].getName());
        }
    } else {
        System.out.println("  <NONE>");
    }

    System.out.println("Cross-Platform:");
    System.out.println(UIManager.getCrossPlatformLookAndFeelClassName());

    System.out.println("System:");
    System.out.println(UIManager.getSystemLookAndFeelClassName());

    System.exit(0);
}

From source file:Main.java

public static void main(String[] args) {
    try {//ww  w  .ja va 2s.com
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (Exception e) {
        e.printStackTrace();
    }
    SwingUtilities.invokeLater(() -> {
        Main frame = new Main();
        frame.pack();
        frame.setVisible(true);
        frame.setExtendedState(frame.MAXIMIZED_BOTH);
    });
}

From source file:Main.java

public static void main(String[] args) throws Exception {
    String[] properties = { "os.name", "java.version", "java.vm.version", "java.vendor" };
    for (String property : properties) {
        System.out.println(property + ": " + System.getProperty(property));
    }/*from  w  w w  . jav a  2  s. co  m*/
    JFileChooser jfc = new JFileChooser();
    jfc.showOpenDialog(null);
    jfc.addChoosableFileFilter(new FileFilter() {
        @Override
        public boolean accept(File f) {
            return f.isDirectory() || f.getName().toLowerCase().endsWith(".obj");
        }

        @Override
        public String getDescription() {
            return "Wavefront OBJ (*.obj)";
        }

        @Override
        public String toString() {
            return getDescription();
        }
    });
    int result = JOptionPane.showConfirmDialog(null, "Description was 'All Files'?");
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    SwingUtilities.updateComponentTreeUI(jfc);
    jfc.showOpenDialog(null);
    result = JOptionPane.showConfirmDialog(null, "Description was 'All Files'?");

    result = JOptionPane.showConfirmDialog(null, "Description was 'All Files'?");
    for (UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
        if ("Nimbus".equals(info.getName())) {
            UIManager.setLookAndFeel(info.getClassName());
            SwingUtilities.updateComponentTreeUI(jfc);
            break;
        }
    }
    jfc.showOpenDialog(null);
    result = JOptionPane.showConfirmDialog(null, "Description was 'All Files'?");
}

From source file:br.com.ant.system.app.AntSystemApp.java

public static void main(String[] args) {

    try {//from  w  ww . j av a2 s. co m
        if (SystemUtils.IS_OS_WINDOWS) {
            UIManager.setLookAndFeel(WindowsClassicLookAndFeel.class.getName());
        } else {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        }

        ColoniaFormigasView frame = new ColoniaFormigasView();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice[] devices = env.getScreenDevices();

        DisplayMode mode = devices[0].getDisplayMode();
        int height = mode.getHeight();
        int width = mode.getWidth();

        frame.setSize(width, height - 30);
        frame.setVisible(true);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}

From source file:com.picklecode.popflix.App.java

/**
 * @param args the command line arguments
 *///from ww w  . j a  v  a2s  .co m
public static void main(String args[]) {

    try {

        javax.swing.UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

    } catch (ClassNotFoundException | InstantiationException | IllegalAccessException
            | javax.swing.UnsupportedLookAndFeelException ex) {
        java.util.logging.Logger.getLogger(Popflix.class.getName()).log(java.util.logging.Level.SEVERE, null,
                ex);
    }

    java.awt.EventQueue.invokeLater(new Runnable() {
        public void run() {
            new Popflix().setVisible(true);
        }
    });
}