Example usage for javax.swing UIManager setLookAndFeel

List of usage examples for javax.swing UIManager setLookAndFeel

Introduction

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

Prototype

@SuppressWarnings("deprecation")
public static void setLookAndFeel(String className) throws ClassNotFoundException, InstantiationException,
        IllegalAccessException, UnsupportedLookAndFeelException 

Source Link

Document

Loads the LookAndFeel specified by the given class name, using the current thread's context class loader, and passes it to setLookAndFeel(LookAndFeel) .

Usage

From source file:com.tiempometa.muestradatos.JMuestraDatos.java

/**
 * Application entry point//  w  ww.  j  av a 2  s  . com
 * 
 * @param args
 */
public static void main(String[] args) {
    try {
        // Set System L&F
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (UnsupportedLookAndFeelException e) {
        // handle exception
    } catch (ClassNotFoundException e) {
        // handle exception
    } catch (InstantiationException e) {
        // handle exception
    } catch (IllegalAccessException e) {
        // handle exception
    }

    logger.info(systemProperties.java_version);
    logger.info(systemProperties.arch_data_model);
    logger.info(systemProperties.java_home);
    logger.info(systemProperties.user_dir);
    if (systemProperties.arch_data_model.equals(InstallUtils.AMD64)) {
        JOptionPane.showMessageDialog(null, "Se requiere Java 32bits para ejecutar este programa",
                "Systema de 64 bits", JOptionPane.WARNING_MESSAGE);
        JInstaller installer = new JInstaller(null);
        installer.setVisible(true);
    } else {
        if (!(systemProperties.getJava_version().startsWith("1.6")
                || systemProperties.getJava_version().startsWith("1.7"))) {
            JOptionPane.showMessageDialog(null, "Se requiere Java 6 o 7 para ejecutar este programa",
                    "Versin de Java no soportada", JOptionPane.WARNING_MESSAGE);
            JInstaller installer = new JInstaller(null);
            installer.setVisible(true);
        } else {
            JMuestraDatos reader = new JMuestraDatos();
            reader.setVisible(true);
        }
    }
}

From source file:org.jfree.chart.demo.Main_window.java

public static void main(String[] args) {
    try {/*from   w w w .  j  a  v  a 2s. c om*/
        UIManager.setLookAndFeel("com.seaglasslookandfeel.SeaGlassLookAndFeel");
        // SeaGlassLNFTest window = new SeaGlassLNFTest();

    } catch (ClassNotFoundException | InstantiationException | IllegalAccessException
            | UnsupportedLookAndFeelException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    }

    Main_window window = new Main_window();

    try {

        Thread.sleep(100000);
    } catch (InterruptedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

}

From source file:EditorPaneExample7.java

public static void main(String[] args) {
    try {//w  ww  .j  a  v a2 s .c o  m
        UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    } catch (Exception evt) {
    }

    JFrame f = new EditorPaneExample7();
    f.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent evt) {
            System.exit(0);
        }
    });
    f.setSize(500, 400);
    f.setVisible(true);
}

From source file:EditorPaneExample6.java

public static void main(String[] args) {
    try {//from   www .java  2 s. c o m
        UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    } catch (Exception evt) {
    }

    JFrame f = new EditorPaneExample6();

    f.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent evt) {
            System.exit(0);
        }
    });
    f.setSize(500, 400);
    f.setVisible(true);
}

From source file:com.moss.appprocs.swing.ProgressMonitorPanel.java

/**
 * Not useful beyond testing this class.
 */// ww w  .j  av  a 2 s . c  o  m
@SuppressWarnings("serial")
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    Action a = new AbstractAction("Do Something") {

        public void actionPerformed(ActionEvent e) {
            JOptionPane.showMessageDialog(null, "Hi");
        }

    };
    JFrame window = new JFrame("Test");
    ProgressMonitorPanel panel = new ProgressMonitorPanel(true);
    panel.addNonPersistentProcess(new TestProcess());
    panel.addNonPersistentProcess(new TestProcess());
    panel.addNonPersistentProcess(new TrackableTestProcess());
    panel.addNonPersistentProcess(new TestProcess());
    panel.addPersistentProcess(new TrackableTestProcess(), a);
    //      
    //      JPanel panel = new JPanel();
    //      panel.add(new JLabel("Howdy"));
    //      panel.setBorder(new LineBorder(Color.BLUE, 5));

    window.getContentPane().add(panel);
    window.setSize(400, 800);
    window.setVisible(true);

    window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}

From source file:io.github.eternalbits.compactvd.CompactVD.java

public static void main(String[] args) throws Exception {

    DiskImageJournal.scanDirectory(Static.getWorkingDirectory());

    if (args.length == 0 && !GraphicsEnvironment.isHeadless()) {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        SwingUtilities.invokeLater(new Runnable() {
            @Override/*from   www. j a  v  a  2s  .  c o m*/
            public void run() {
                new FrontEnd();
            }
        });
        return;
    }

    new CompactVD().commandLine(args);

}

From source file:br.com.jinsync.view.FrmJInSync.java

/**
 * Launch the application./*  w  ww .j  a v a2s  .c o  m*/
 */
public static void main(String[] args) {
    try {
        UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    } catch (Throwable e) {
        e.printStackTrace();
    }

    EventQueue.invokeLater(new Runnable() {
        @Override
        public void run() {
            try {
                frmJInSync = new FrmJInSync();
                frmJInSync.setLocationRelativeTo(null);
                frmJInSync.setVisible(true);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });

}

From source file:EditorPaneExample10A.java

public static void main(String[] args) {
    try {/*w w w .j  ava 2 s  . c  om*/
        UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    } catch (Exception evt) {
    }

    JFrame f = new EditorPaneExample10A();

    f.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent evt) {
            System.exit(0);
        }
    });
    f.setSize(500, 400);
    f.setVisible(true);
}

From source file:edu.esprit.sweet4u.GUI.Statistique.java

/**
 * @param args the command line arguments
 *//* w w  w.  ja  va2s . c o m*/
public static void main(String args[]) {
    /* Set the Nimbus look and feel */
    //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
    /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
     * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
     */
    try {
        for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
            //                if ("Nimbus".equals(info.getName())) {
            //                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
            //                    break;
            //                }
            UIManager.setLookAndFeel("com.jtattoo.plaf.smart.SmartLookAndFeel");

        }
    } catch (ClassNotFoundException ex) {
        java.util.logging.Logger.getLogger(Statistique.class.getName()).log(java.util.logging.Level.SEVERE,
                null, ex);
    } catch (InstantiationException ex) {
        java.util.logging.Logger.getLogger(Statistique.class.getName()).log(java.util.logging.Level.SEVERE,
                null, ex);
    } catch (IllegalAccessException ex) {
        java.util.logging.Logger.getLogger(Statistique.class.getName()).log(java.util.logging.Level.SEVERE,
                null, ex);
    } catch (javax.swing.UnsupportedLookAndFeelException ex) {
        java.util.logging.Logger.getLogger(Statistique.class.getName()).log(java.util.logging.Level.SEVERE,
                null, ex);
    }
    //</editor-fold>

    /* Create and display the form */
    java.awt.EventQueue.invokeLater(new Runnable() {
        public void run() {
            new Statistique().setVisible(true);
        }
    });
}

From source file:com.streamhub.StreamHubLicenseGenerator.java

public static void main(String[] args) {
    JFrame.setDefaultLookAndFeelDecorated(true);

    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            try {
                UIManager.setLookAndFeel(new SubstanceGraphiteLookAndFeel());
            } catch (Exception e) {
                System.out.println("Substance Graphite failed to initialize");
            }//w  w  w  . j  a  va 2s .c  om
            StreamHubLicenseGenerator w = new StreamHubLicenseGenerator();
            w.setVisible(true);
        }
    });
}