Example usage for javax.swing JFrame setDefaultLookAndFeelDecorated

List of usage examples for javax.swing JFrame setDefaultLookAndFeelDecorated

Introduction

In this page you can find the example usage for javax.swing JFrame setDefaultLookAndFeelDecorated.

Prototype

public static void setDefaultLookAndFeelDecorated(boolean defaultLookAndFeelDecorated) 

Source Link

Document

Provides a hint as to whether or not newly created JFrames should have their Window decorations (such as borders, widgets to close the window, title...) provided by the current look and feel.

Usage

From source file:WindowEventDemo.java

/**
 * Create the GUI and show it. For thread safety, this method should be
 * invoked from the event-dispatching thread.
 *///from   w w  w. j  a v  a2  s . com
private static void createAndShowGUI() {
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);

    //Create and set up the window.
    frame = new JFrame("WindowEventDemo");
    frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);

    //Create and set up the content pane.
    JComponent newContentPane = new WindowEventDemo();
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newContentPane);

    //Display the window.
    frame.pack();
    frame.setVisible(true);
}

From source file:FormatterFactoryDemo.java

/**
 * Create the GUI and show it.  For thread safety,
 * this method should be invoked from the
 * event-dispatching thread./*ww w .  jav  a2s  . co  m*/
 */
private static void createAndShowGUI() {
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);

    //Create and set up the window.
    JFrame frame = new JFrame("FormatterFactoryDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    //Create and set up the content pane.
    JComponent newContentPane = new FormatterFactoryDemo();
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newContentPane);

    //Display the window.
    frame.pack();
    frame.setVisible(true);
}

From source file:InternalFrameEventDemo.java

/**
 * Create the GUI and show it. For thread safety, this method should be
 * invoked from the event-dispatching thread.
 *//*from w  w  w.j  a  v a2  s . com*/
private static void createAndShowGUI() {
    // Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);

    // Create and set up the window.
    JFrame frame = new InternalFrameEventDemo("InternalFrameEventDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    // Display the window.
    frame.pack();
    frame.setVisible(true);
}

From source file:BasicDnD.java

/**
 * Create the GUI and show it. For thread safety, this method should be
 * invoked from the event-dispatching thread.
 *//*from  ww w  .j av  a2 s . c o  m*/
private static void createAndShowGUI() {
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);

    //Create and set up the window.
    frame = new JFrame("BasicDnD");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    //Create and set up the content pane.
    JComponent newContentPane = new BasicDnD();
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newContentPane);

    //Display the window.
    frame.pack();
    frame.setVisible(true);
}

From source file:net.sf.keystore_explorer.gui.CreateApplicationGui.java

private static void initLookAndFeel(ApplicationSettings applicationSettings) {
    LnfUtil.installLnfs();/*from ww w . java 2 s .  c  om*/

    String lookFeelClassName = applicationSettings.getLookAndFeelClass();

    if (lookFeelClassName != null) {
        LnfUtil.useLnf(lookFeelClassName);
    } else {
        String lookAndFeelClass = LnfUtil.useLnfForPlatform();
        applicationSettings.setLookAndFeelClass(lookAndFeelClass);
    }

    boolean lookFeelDecorated = applicationSettings.getLookAndFeelDecorated();

    JFrame.setDefaultLookAndFeelDecorated(lookFeelDecorated);
    JDialog.setDefaultLookAndFeelDecorated(lookFeelDecorated);
}

From source file:InternalFrameEventDemo.java

/**
 * Create the GUI and show it. For thread safety, this method should be
 * invoked from the event-dispatching thread.
 *//*from   w  w  w .  j  a  v a2  s.c o m*/
private static void createAndShowGUI() {
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);

    //Create and set up the window.
    JFrame frame = new InternalFrameEventDemo("InternalFrameEventDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    //Display the window.
    frame.pack();
    frame.setVisible(true);
}

From source file:MenuDemo.java

/**
 * Create the GUI and show it. For thread safety, this method should be
 * invoked from the event-dispatching thread.
 *///from w  w w.j a  v a 2  s .c om
private static void createAndShowGUI() {
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);

    //Create and set up the window.
    JFrame frame = new JFrame("MenuDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    //Create and set up the content pane.
    MenuDemo demo = new MenuDemo();
    frame.setJMenuBar(demo.createMenuBar());
    frame.setContentPane(demo.createContentPane());

    //Display the window.
    frame.setSize(450, 260);
    frame.setVisible(true);
}

From source file:TableToolTipsDemo.java

/**
 * Create the GUI and show it. For thread safety, this method should be
 * invoked from the event-dispatching thread.
 *//*from   w  ww . j a v  a  2s .  c  o  m*/
private static void createAndShowGUI() {
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);

    //Create and set up the window.
    JFrame frame = new JFrame("TableToolTipsDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    //Create and set up the content pane.
    JComponent newContentPane = new TableToolTipsDemo();
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newContentPane);

    //Display the window.
    frame.pack();
    frame.setVisible(true);
}

From source file:DragPictureDemo2.java

/**
 * Create the GUI and show it. For thread safety, this method should be
 * invoked from the event-dispatching thread.
 *//*w w  w  .  ja  va  2s  .co  m*/
private static void createAndShowGUI() {
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);

    //Create and set up the window.
    JFrame frame = new JFrame("DragPictureDemo2");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    //Create and set up the menu bar and content pane.
    DragPictureDemo2 demo = new DragPictureDemo2();
    frame.setJMenuBar(demo.createMenuBar());
    demo.setOpaque(true); //content panes must be opaque
    frame.setContentPane(demo);

    //Display the window.
    frame.pack();
    frame.setVisible(true);
}

From source file:components.FrameDemo2.java

public void actionPerformed(ActionEvent e) {
    String command = e.getActionCommand();

    //Handle the New window button.
    if (CREATE_WINDOW.equals(command)) {
        showNewWindow();//from w w w.  ja  v a2 s .c o m

        //Handle the first group of radio buttons.
    } else if (NO_DECORATIONS.equals(command)) {
        noDecorations = true;
        JFrame.setDefaultLookAndFeelDecorated(false);
    } else if (WS_DECORATIONS.equals(command)) {
        noDecorations = false;
        JFrame.setDefaultLookAndFeelDecorated(false);
    } else if (LF_DECORATIONS.equals(command)) {
        noDecorations = false;
        JFrame.setDefaultLookAndFeelDecorated(true);

        //Handle the second group of radio buttons.
    } else if (DEFAULT_ICON.equals(command)) {
        specifyIcon = false;
    } else if (FILE_ICON.equals(command)) {
        specifyIcon = true;
        createIcon = false;
    } else if (PAINT_ICON.equals(command)) {
        specifyIcon = true;
        createIcon = true;
    }
}