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

public static void main(String[] args) {
    JFrame.setDefaultLookAndFeelDecorated(true);
    JFrame f = new JFrame();
    f.setBackground(new Color(0, true)); // 1.7.0
    f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    f.getContentPane().add(makeUI());/*from  w ww.j  a  va2  s.  c  o  m*/
    f.setSize(320, 240);
    f.setLocationRelativeTo(null);
    f.setVisible(true);
}

From source file:Main.java

public static void main(String[] args) {
    JFrame.setDefaultLookAndFeelDecorated(true);
    JFrame frame = new JFrame();
    frame.setResizable(false);//from ww w .  j av a  2 s. c  o m
    removeButtons(frame);
    JPanel panel = new JPanel(new GridBagLayout());
    JButton button = new JButton("Exit");
    panel.add(button, new GridBagConstraints());
    frame.getContentPane().add(panel);
    frame.setSize(400, 300);
    frame.setLocationRelativeTo(null);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);
    button.addActionListener(e -> System.exit(0));
}

From source file:Test.java

public static void main(String[] args) {
    GraphicsEnvironment envmt = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice device = envmt.getDefaultScreenDevice();

    if (!device.isWindowTranslucencySupported(WindowTranslucency.PERPIXEL_TRANSLUCENT)) {
        System.out.println("Translucent windows are not supported on your system.");
        System.exit(0);//from w w  w .  j  a  v a 2  s. com
    }
    JFrame.setDefaultLookAndFeelDecorated(true);
    ApplicationWindow window = new ApplicationWindow();
    window.setVisible(true);
}

From source file:MouseClickListener.java

public static void main(String[] args) {
    JFrame.setDefaultLookAndFeelDecorated(true);
    JFrame frame = new JFrame("MouseListener Test 1");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.addMouseListener(new MouseClickListener());
    frame.setSize(200, 200);/*from w  ww. j  a va2s.c  o  m*/
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] args) {
    JFrame.setDefaultLookAndFeelDecorated(true);
    Window w = new Main();
    w.setVisible(true);//www . j a v  a 2  s. c o m
    com.sun.awt.AWTUtilities.setWindowOpacity(w, 0.7f);
}

From source file:CardLayoutDemo.java

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

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

    CardLayoutDemo demo = new CardLayoutDemo();
    demo.addCardsToPane(frame.getContentPane());

    frame.pack();/* ww w.j  a  v  a2 s.  c o  m*/
    frame.setVisible(true);
}

From source file:AddressDialog.java

public static void main(String[] args) {
    JFrame.setDefaultLookAndFeelDecorated(true);
    JDialog.setDefaultLookAndFeelDecorated(true);
    JDialogTest frame = new JDialogTest();
    frame.pack();// ww w . ja va 2s .c om
    frame.setVisible(true);
}

From source file:misc.TranslucentWindowDemo.java

public static void main(String[] args) {
    // Determine if the GraphicsDevice supports translucency.
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice gd = ge.getDefaultScreenDevice();

    //If translucent windows aren't supported, exit.
    if (!gd.isWindowTranslucencySupported(TRANSLUCENT)) {
        System.err.println("Translucency is not supported");
        System.exit(0);//from ww w.j  a  va 2  s  .  c o  m
    }

    JFrame.setDefaultLookAndFeelDecorated(true);

    // Create the GUI on the event-dispatching thread
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            TranslucentWindowDemo tw = new TranslucentWindowDemo();

            // Set the window to 55% opaque (45% translucent).
            tw.setOpacity(0.55f);

            // Display the window.
            tw.setVisible(true);
        }
    });
}

From source file:SimpleDraw.java

public static void main(String[] args) {
    JFrame.setDefaultLookAndFeelDecorated(true);
    SimpleDraw frame = new SimpleDraw();
    frame.pack();/*from   ww w.  jav  a  2  s.  c  o  m*/
    frame.setVisible(true);
}

From source file:misc.GradientTranslucentWindowDemo.java

public static void main(String[] args) {
    // Determine what the GraphicsDevice can support.
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice gd = ge.getDefaultScreenDevice();
    boolean isPerPixelTranslucencySupported = gd.isWindowTranslucencySupported(PERPIXEL_TRANSLUCENT);

    //If translucent windows aren't supported, exit.
    if (!isPerPixelTranslucencySupported) {
        System.out.println("Per-pixel translucency is not supported");
        System.exit(0);/*  w w  w  . j  a  v a 2  s  . com*/
    }

    JFrame.setDefaultLookAndFeelDecorated(true);

    // Create the GUI on the event-dispatching thread
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            GradientTranslucentWindowDemo gtw = new GradientTranslucentWindowDemo();

            // Display the window.
            gtw.setVisible(true);
        }
    });
}