List of usage examples for javax.swing JFrame setDefaultLookAndFeelDecorated
public static void setDefaultLookAndFeelDecorated(boolean defaultLookAndFeelDecorated)
JFrame
s should have their Window decorations (such as borders, widgets to close the window, title...) provided by the current look and feel. From source file:Beeper.java
/** * Create the GUI and show it. For thread safety, this method should be * invoked from the event-dispatching thread. *//* w w w. j av a 2s . 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("Beeper"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //Create and set up the content pane. JComponent newContentPane = new Beeper(); newContentPane.setOpaque(true); //content panes must be opaque frame.setContentPane(newContentPane); //Display the window. frame.pack(); frame.setVisible(true); }
From source file:MenuGlueDemo.java
/** * Create the GUI and show it. For thread safety, this method should be * invoked from the event-dispatching thread. */// w w w . j av a 2s . com private static void createAndShowGUI() { //Make sure we have nice window decorations. JFrame.setDefaultLookAndFeelDecorated(true); //Create and set up the window. JFrame frame = new JFrame("MenuGlueDemo"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //Create and set up the content pane. MenuGlueDemo demo = new MenuGlueDemo(); frame.setContentPane(demo.createMenuBar()); //Display the window. frame.setSize(300, 100); frame.setVisible(true); }
From source file:AbsoluteLayoutDemo.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 va2 s .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("AbsoluteLayoutDemo"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //Set up the content pane. addComponentsToPane(frame.getContentPane()); //Size and display the window. Insets insets = frame.getInsets(); frame.setSize(300 + insets.left + insets.right, 125 + insets.top + insets.bottom); frame.setVisible(true); }
From source file:SpringCompactGrid.java
/** * Create the GUI and show it. For thread safety, this method should be * invoked from the event-dispatching thread. *///from w ww.ja v a 2 s. c o m private static void createAndShowGUI() { JPanel panel = new JPanel(new SpringLayout()); int rows = 10; int cols = 10; for (int r = 0; r < rows; r++) { for (int c = 0; c < cols; c++) { int anInt = (int) Math.pow(r, c); JTextField textField = new JTextField(Integer.toString(anInt)); panel.add(textField); } } //Lay out the panel. SpringUtilities.makeCompactGrid(panel, //parent rows, cols, 3, 3, //initX, initY 3, 3); //xPad, yPad //Make sure we have nice window decorations. JFrame.setDefaultLookAndFeelDecorated(true); //Create and set up the window. JFrame frame = new JFrame("SpringCompactGrid"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //Set up the content pane. panel.setOpaque(true); //content panes must be opaque frame.setContentPane(panel); //Display the window. frame.pack(); frame.setVisible(true); }
From source file:net.fenyo.gnetwatch.GUI.AwtGUI.java
/** * Creates a thread that will repaint each frame regularly. * @param none./* ww w. j av a 2s . c o m*/ * @return void. */ // GUI thread public void createAwtGUI() { JFrame.setDefaultLookAndFeelDecorated(false); createRepaintThread(); }
From source file:MenuLayoutDemo.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 va 2 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 JFrame("MenuLayoutDemo"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //Create and set up the content pane. MenuLayoutDemo demo = new MenuLayoutDemo(); Container contentPane = frame.getContentPane(); contentPane.setBackground(Color.WHITE); //contrasting bg contentPane.add(demo.createMenuBar(), BorderLayout.LINE_START); //Display the window. frame.setSize(300, 150); frame.setVisible(true); }
From source file:ShowDocument.java
private void createGUI() { JButton button = new JButton("Bring up URL window"); button.addActionListener(this); add(button);/*from www . j a v a 2s . co m*/ JFrame.setDefaultLookAndFeelDecorated(true); urlWindow = new URLWindow(getAppletContext()); urlWindow.pack(); }
From source file:com.haulmont.cuba.desktop.theme.impl.DesktopThemeImpl.java
@Override public void init() { JDialog.setDefaultLookAndFeelDecorated(true); JFrame.setDefaultLookAndFeelDecorated(true); try {//from w ww . j a va2s . c o m UIManager.setLookAndFeel(lookAndFeel); initUIDefaults(); initButtonsKeyBinding(); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) { throw new RuntimeException(e); } if (marginSize != null) { UnitValue marginValue = new UnitValue(marginSize); PlatformDefaults.setPanelInsets(marginValue, marginValue, marginValue, marginValue); } if (spacingSize != null) { UnitValue spacingValue = new UnitValue(spacingSize); PlatformDefaults.setGridCellGap(spacingValue, spacingValue); } }
From source file:TextDemo.java
/** * Create the GUI and show it. For thread safety, this method should be * invoked from the event-dispatching thread. *///from ww w . j a v a 2 s. 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("TextDemo"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //Create and set up the content pane. JComponent newContentPane = new TextDemo(); newContentPane.setOpaque(true); //content panes must be opaque frame.setContentPane(newContentPane); //Display the window. frame.pack(); frame.setVisible(true); }
From source file:FocusConceptsDemo.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 av 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. frame = new JFrame("FocusConceptsDemo"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //Create and set up the content pane. JComponent newContentPane = new FocusConceptsDemo(); newContentPane.setOpaque(true); //content panes must be opaque frame.setContentPane(newContentPane); //Display the window. frame.pack(); frame.setVisible(true); }