Example usage for javax.swing JFrame setVisible

List of usage examples for javax.swing JFrame setVisible

Introduction

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

Prototype

public void setVisible(boolean b) 

Source Link

Document

Shows or hides this Window depending on the value of parameter b .

Usage

From source file:Main.java

public static void main(String[] args) {
    JFrame frame = new JFrame();
    frame.getContentPane().add(new Main());

    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(400, 400);/*from   ww  w.  j  a v  a 2 s  .com*/
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] args) {
    JTextField firstField = new JTextField(10);
    JTextField middleField = new JTextField(10);
    JTextField lastField = new JTextField(10);

    JLabel firstLabel = new JLabel("First Name", JLabel.RIGHT);
    firstLabel.setDisplayedMnemonic('F');
    firstLabel.setLabelFor(firstField);/*from   w  ww  .j a v a2 s .com*/

    JLabel middleLabel = new JLabel("Middle Initial", JLabel.RIGHT);
    middleLabel.setDisplayedMnemonic('I');
    middleLabel.setDisplayedMnemonicIndex(7);
    middleLabel.setLabelFor(middleField);

    JLabel lastLabel = new JLabel("Last Name", JLabel.RIGHT);
    lastLabel.setDisplayedMnemonic('L');
    lastLabel.setLabelFor(lastField);

    JPanel p = new JPanel();
    p.setLayout(new GridLayout(3, 2, 5, 5));
    p.add(firstLabel);
    p.add(firstField);
    p.add(middleLabel);
    p.add(middleField);
    p.add(lastLabel);
    p.add(lastField);

    JFrame f = new JFrame("MnemonicLabels");
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setContentPane(p);
    f.pack();
    f.setVisible(true);
}

From source file:ArabicDigitsI18N.java

public static void main(String[] argv) {
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add("Center", new ArabicDigitsI18N());
    frame.pack();/*from ww  w.j a v a2  s. c o m*/
    frame.setVisible(true);
}

From source file:CompositingDST.java

public static void main(String[] args) {
    JFrame frame = new JFrame("Composition");
    frame.add(new CompositingDST());
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(400, 120);/* ww w . j  a va 2s  . c om*/
    frame.setVisible(true);
}

From source file:TitledExample.java

public static void main(String s[]) {
    JFrame frame = new JFrame("Borders");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(200, 100);/*from   w w w. j ava2s.co  m*/
    frame.setContentPane(new TitledExample());
    frame.setVisible(true);
}

From source file:MainClass.java

public static void main(String[] args) {
    JFrame f = new MainClass();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setVisible(true);
}

From source file:Main.java

public static void main(String[] args) {
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.add(new Main());
    frame.setSize(200, 200);/*from w  ww  . jav a 2 s  .c o  m*/
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] args) {
    Main paintEg = new Main();

    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(paintEg);
    frame.pack();//from   www.  ja  v  a2s.c  o m
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] av) {

    JFrame frame = new JFrame();
    Container cp = frame.getContentPane();
    cp.add(new DriveTree(new File(".")));
    frame.pack();//from  w  ww  . j a  v a 2 s.  c  o m
    frame.setVisible(true);
    frame.setSize(300, 500);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}

From source file:Main.java

public static void main(String[] args) {
    JFrame frame = new JFrame("ColorPan");
    frame.getContentPane().add(new Main());
    frame.setSize(300, 300);// w w  w  .j av a 2 s .c o m
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);
}