Example usage for javax.swing JRootPane FRAME

List of usage examples for javax.swing JRootPane FRAME

Introduction

In this page you can find the example usage for javax.swing JRootPane FRAME.

Prototype

int FRAME

To view the source code for javax.swing JRootPane FRAME.

Click Source Link

Document

Constant used for the windowDecorationStyle property.

Usage

From source file:MainClass.java

public static void main(final String args[]) {
    JFrame frame = new JFrame("Adornment Example");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setUndecorated(true);/*w w w.  j av  a  2 s  .  c o m*/
    frame.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
    frame.setSize(300, 100);
    frame.setVisible(true);

}

From source file:AdornSample.java

public static void main(final String args[]) {
    JFrame frame = new JFrame("Adornment Example");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setUndecorated(true);/*from  w w w.  j  a  va  2s.  c o  m*/
    frame.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
    frame.setSize(300, 100);
    frame.setVisible(true);
}

From source file:Main.java

public static void main(final String args[]) {
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setSize(300, 300);// www.  j  a v a  2 s.  c  om
    f.setLocationRelativeTo(null);

    f.setUndecorated(true);
    f.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);

    JPanel panel = new JPanel();
    panel.setBackground(java.awt.Color.white);
    f.setContentPane(panel);

    MetalLookAndFeel.setCurrentTheme(new MyDefaultMetalTheme());
    try {
        UIManager.setLookAndFeel(new MetalLookAndFeel());
    } catch (Exception e) {
        e.printStackTrace();
    }

    SwingUtilities.updateComponentTreeUI(f);

    f.setVisible(true);
}

From source file:Main.java

public static void main_helper(String args[]) {
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    f.setSize(300, 300);/*  w  w w. ja v a  2s. c  o m*/

    f.setUndecorated(true);
    f.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);

    JPanel panel = new JPanel();
    panel.setBackground(java.awt.Color.white);
    f.setContentPane(panel);

    MetalLookAndFeel.setCurrentTheme(new MyDefaultMetalTheme());

    try {
        UIManager.setLookAndFeel(new MetalLookAndFeel());
    } catch (Exception e) {
        e.printStackTrace();
    }

    SwingUtilities.updateComponentTreeUI(f);

    f.setVisible(true);

}