Example usage for javax.swing JFrame show

List of usage examples for javax.swing JFrame show

Introduction

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

Prototype

@Deprecated
public void show() 

Source Link

Document

Makes the Window visible.

Usage

From source file:Hypnosis.java

/** This is a main() method for testing the component */
public static void main(String[] args) {
    JFrame f = new JFrame("Hypnosis");
    Hypnosis h = new Hypnosis(200, 200, 10, 100, 0, 11 * Math.PI, 7, 100, 2 * Math.PI / 30, 3, 5);
    f.getContentPane().add(h, BorderLayout.CENTER);
    f.setSize(400, 400);// w ww  .j  a v a  2s  .  com
    f.show();
    h.start();
}

From source file:Main.java

public static void main(String args[]) {
    JFrame frame = new JFrame("");
    Container contentPane = frame.getContentPane();
    Icon icon = new PieIcon(Color.red);
    JButton b = new JButton("Button!", icon);
    contentPane.add(b, BorderLayout.NORTH);
    b = new JButton(icon);
    contentPane.add(b, BorderLayout.SOUTH);
    frame.setSize(300, 200);/*from  ww w.j av  a2  s. c  o  m*/
    frame.show();
}

From source file:OvalBorder.java

public static void main(String[] s) {
    JFrame f = new JFrame("Oval Border");
    f.setSize(100, 100);//from w  ww  . j av  a 2  s. c o  m

    JPanel p = new JPanel(new GridLayout(0, 1, 5, 5));
    JLabel l = new JLabel("Oval Border");

    l.setBorder(new OvalBorder());

    p.add(l);
    p.setBorder(new OvalBorder());

    f.getContentPane().add(p);
    f.show();
}

From source file:FormattedTest.java

public static void main(String args[]) {
    JFrame frame = new JFrame("Formatted");
    Container contentPane = frame.getContentPane();
    JFormattedTextField ftf1 = new JFormattedTextField(new Integer(0));
    contentPane.add(ftf1, BorderLayout.NORTH);
    JFormattedTextField ftf2 = new JFormattedTextField(new Date());
    contentPane.add(ftf2, BorderLayout.SOUTH);
    frame.setSize(200, 100);// ww w.  j  av a  2  s.  c  om
    frame.show();
}

From source file:TabbedPaneTest.java

public static void main(String args[]) {
    JFrame frame = new JFrame("JTabbedPane");
    final Container contentPane = frame.getContentPane();
    JTabbedPane jtp = new JTabbedPane();
    contentPane.add(jtp, BorderLayout.CENTER);
    for (int i = 0; i < 5; i++) {
        JButton button = new JButton("Card " + i);
        jtp.add("Btn " + i, button);
    }/*w w  w. j  av a2s  .c  om*/
    frame.setSize(300, 200);
    frame.show();
}

From source file:ButtonBorderTest.java

public static void main(String args[]) {
    JFrame frame = new JFrame("Fourth Button");
    Container contentPane = frame.getContentPane();
    Icon icon = new ImageIcon("java2s.gif");
    JButton b = new JButton("Button!");
    Border bored = BorderFactory.createMatteBorder(10, 5, 10, 5, icon);
    b.setBorder(bored);//from w  ww. j  ava 2 s .com
    contentPane.add(b, BorderLayout.CENTER);
    frame.setSize(350, 200);
    frame.show();
}

From source file:XORPanel.java

public static void main(String[] args) {
    JFrame frame = new JFrame();
    frame.setTitle("XOR");
    frame.setSize(300, 200);/*from  w w w .j a  va 2s.  c  o m*/
    frame.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);
        }
    });
    Container contentPane = frame.getContentPane();
    contentPane.add(new XORPanel());

    frame.show();
}

From source file:BasicStrokeDemo.java

public static void main(String s[]) {
    JFrame f = new JFrame();
    f.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);/*from w  w  w .  j  av  a 2s  .  c om*/
        }
    });
    BasicStrokeDemo p = new BasicStrokeDemo();
    f.getContentPane().add("Center", p);
    p.init();
    f.pack();
    f.setSize(new Dimension(250, 250));
    f.show();
}

From source file:ThickStrokeDemo.java

public static void main(String s[]) {
    JFrame f = new JFrame();
    f.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);//from ww w.ja v a  2s  . c o  m
        }
    });
    ThickStrokeDemo p = new ThickStrokeDemo();
    f.getContentPane().add("Center", p);
    p.init();
    f.pack();
    f.setSize(new Dimension(250, 250));
    f.show();
}

From source file:DrawRectPanel.java

public static void main(String[] args) {
    JFrame frame = new JFrame();
    frame.setTitle("DrawRect");
    frame.setSize(300, 200);/*from  w  ww . j  av  a  2s .c o m*/
    frame.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);
        }
    });
    Container contentPane = frame.getContentPane();
    contentPane.add(new DrawRectPanel());

    frame.show();
}