Example usage for javax.swing UIManager put

List of usage examples for javax.swing UIManager put

Introduction

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

Prototype

public static Object put(Object key, Object value) 

Source Link

Document

Stores an object in the developer defaults.

Usage

From source file:FileChooserDemo2.java

public static void main(String[] args) {
    // Schedule a job for the event dispatch thread:
    // creating and showing this application's GUI.
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            // Turn off metal's use of bold fonts
            UIManager.put("swing.boldMetal", Boolean.FALSE);
            createAndShowGUI();//from   www  .  j  a v a  2 s  .c om
        }
    });
}

From source file:components.LabelDemo.java

public static void main(String[] args) {
    //Schedule a job for the event dispatch thread:
    //creating and showing this application's GUI.
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            //Turn off metal's use of bold fonts
            UIManager.put("swing.boldMetal", Boolean.FALSE);

            createAndShowGUI();/*  w  ww  .  jav  a 2s. com*/
        }
    });
}

From source file:layout.BorderLayoutDemo.java

public static void main(String[] args) {
    /* Use an appropriate Look and Feel */
    try {//from  www  .j  av a 2  s . com
        //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
    } catch (UnsupportedLookAndFeelException ex) {
        ex.printStackTrace();
    } catch (IllegalAccessException ex) {
        ex.printStackTrace();
    } catch (InstantiationException ex) {
        ex.printStackTrace();
    } catch (ClassNotFoundException ex) {
        ex.printStackTrace();
    }
    /* Turn off metal's use bold fonts */
    UIManager.put("swing.boldMetal", Boolean.FALSE);

    //Schedule a job for the event dispatch thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            createAndShowGUI();
        }
    });
}

From source file:layout.CardLayoutDemo.java

public static void main(String[] args) {
    /* Use an appropriate Look and Feel */
    try {//  w  w  w  . j  av a  2  s . c  o  m
        //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
    } catch (UnsupportedLookAndFeelException ex) {
        ex.printStackTrace();
    } catch (IllegalAccessException ex) {
        ex.printStackTrace();
    } catch (InstantiationException ex) {
        ex.printStackTrace();
    } catch (ClassNotFoundException ex) {
        ex.printStackTrace();
    }
    /* Turn off metal's use of bold fonts */
    UIManager.put("swing.boldMetal", Boolean.FALSE);

    //Schedule a job for the event dispatch thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            createAndShowGUI();
        }
    });
}

From source file:misc.TablePrintDemo3.java

/**
 * Start the application.//  w  w w. j  av  a 2 s.  co m
 */
public static void main(final String[] args) {
    /* Schedule for the GUI to be created and shown on the EDT */
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            /* Don't want bold fonts if we end up using metal */
            UIManager.put("swing.boldMetal", false);
            try {
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            } catch (Exception e) {
            }
            new TablePrintDemo3().setVisible(true);
        }
    });
}

From source file:dnd.ChooseDropActionDemo.java

public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            //Turn off metal's use of bold fonts
            UIManager.put("swing.boldMetal", Boolean.FALSE);
            createAndShowGUI();/*  w  w  w  .  j  a va 2  s. c  o  m*/
        }
    });
}

From source file:misc.DesktopDemo.java

public static void main(String args[]) {
    /* Use an appropriate Look and Feel */
    try {// ww  w . j  a v a2s. c o m
        //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        //UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
        UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
    } catch (UnsupportedLookAndFeelException ex) {
        ex.printStackTrace();
    } catch (IllegalAccessException ex) {
        ex.printStackTrace();
    } catch (InstantiationException ex) {
        ex.printStackTrace();
    } catch (ClassNotFoundException ex) {
        ex.printStackTrace();
    }
    /* Turn off metal's use of bold fonts */
    UIManager.put("swing.boldMetal", Boolean.FALSE);
    //Schedule a job for the event-dispatching thread:
    //creating and showing this application's GUI.
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            new DesktopDemo().setVisible(true);
        }
    });
}

From source file:net.pandoragames.far.ui.swing.FindAndReplace.java

/**
 * The main method. Expects no arguments.
 * /* w ww.ja va 2  s  .c  om*/
 * @param args
 *            not evaluated
 */
public static void main(String[] args) {
    if (FARConfig.getEffectiveJavaVersion() == 0) { // obscure jvm
        LogFactory.getLog(FindAndReplace.class)
                .warn("Java version could not be read. This may very well lead to unexpected crashes");
    } else if (FARConfig.getEffectiveJavaVersion() < 5) { // won't work -
        // exit
        LogFactory.getLog(FindAndReplace.class)
                .error("FAR requires java 5 (1.5.x) or higher. Found 1." + FARConfig.getEffectiveJavaVersion());
        System.exit(1);
    } else {
        LogFactory.getLog(FindAndReplace.class).debug("Running on java " + FARConfig.getEffectiveJavaVersion());
    }
    JFrame.setDefaultLookAndFeelDecorated(SwingConfig.isMacOSX());
    UIManager.put("Button.defaultButtonFollowsFocus", Boolean.TRUE);
    FindAndReplace far = new FindAndReplace();
    far.configure();
    far.init();
    far.pack();
    far.setVisible(true);
    // First time initialisation - speeds up the loading of the help views
    HelpView helpView = new HelpView(far, "About", "about.html", new Point(100, 100));
    helpView.pack();
    helpView.setVisible(false);

    if (args.length > 0 && SwingConfig.getEffectiveJavaVersion() > 5) {
        List<File> fileList = new ArrayList<File>();
        for (String arg : args) {
            File file = new File(arg);
            if (file.exists())
                fileList.add(file);
        }
        if (fileList.size() > 0) {
            far.fileImporter.importFiles(fileList);
        }
    }

    if (far.config.versionHasChanged()) {
        UpdateDialog updateWizzard = new UpdateDialog(far, far.config, far.componentRepository);
        if (updateWizzard.isUserInteractionRequired()) {
            updateWizzard.pack();
            updateWizzard.setVisible(true);
        } else {
            updateWizzard.dispose();
        }
    }
}

From source file:ChooseDropActionDemo.java

public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            // Turn off metal's use of bold fonts
            UIManager.put("swing.boldMetal", Boolean.FALSE);
            createAndShowGUI();/*from  w w  w.j  a  v  a2s  .c  o m*/
        }
    });
}

From source file:DropDemo.java

public static void main(String[] args) {
    //Schedule a job for the event-dispatching thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            //Turn off metal's use of bold fonts
            UIManager.put("swing.boldMetal", Boolean.FALSE);
            createAndShowGUI();//from w w w  .  j  a v  a 2 s  . co m
        }
    });
}