List of usage examples for javax.swing JFrame show
@Deprecated public void show()
From source file:GradientPaintDemo2D.java
public static void main(String s[]) { JFrame f = new JFrame(""); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0);/*w w w . j a va 2 s . c o m*/ } }); JApplet applet = new GradientPaintDemo2D(); f.getContentPane().add("Center", applet); applet.init(); f.pack(); f.setSize(new Dimension(300, 300)); f.show(); }
From source file:RedBlueBox.java
public static void main(String args[]) { JFrame frame = new JFrame(); Container contentPane = frame.getContentPane(); contentPane.setLayout(new GridLayout(0, 1)); JComponent comp = new RedBlueBox(); comp.setBorder(BorderFactory.createMatteBorder(5, 5, 5, 5, Color.PINK)); contentPane.add(comp);/*from w ww. ja v a 2 s .co m*/ comp = new RedBlueBox(); contentPane.add(comp); frame.setSize(300, 200); frame.show(); }
From source file:DashedRectangleDemo2D.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 a v a 2 s. c o m } }); JApplet applet = new DashedRectangleDemo2D(); f.getContentPane().add("Center", applet); applet.init(); f.pack(); f.setSize(new Dimension(300, 300)); f.show(); }
From source file:GeneralPathDemo2D.java
public static void main(String s[]) { JFrame f = new JFrame(""); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0);/*from www . j a v a 2 s .c o m*/ } }); JApplet applet = new GeneralPathDemo2D(); f.getContentPane().add("Center", applet); applet.init(); f.pack(); f.setSize(new Dimension(300, 300)); f.show(); }
From source file:SketchPanel.java
public static void main(String[] args) { JFrame frame = new JFrame(); frame.setTitle("Sketch"); frame.setSize(300, 200);/*from w w w .j a v a2s . co m*/ frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); Container contentPane = frame.getContentPane(); contentPane.add(new SketchPanel()); frame.show(); }
From source file:FilledGeneralPath.java
public static void main(String s[]) { JFrame f = new JFrame(""); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0);// w w w . j av a 2 s .co m } }); JApplet applet = new FilledGeneralPath(); f.getContentPane().add("Center", applet); applet.init(); f.pack(); f.setSize(new Dimension(300, 300)); f.show(); }
From source file:GeneralPathOpenDemo2D.java
public static void main(String s[]) { JFrame f = new JFrame(""); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0);/* www . j a va 2 s . com*/ } }); JApplet applet = new GeneralPathOpenDemo2D(); f.getContentPane().add("Center", applet); applet.init(); f.pack(); f.setSize(new Dimension(300, 300)); f.show(); }
From source file:EventQueuePanel.java
public static void main(String[] args) { JFrame frame = new JFrame(); frame.setTitle("EventQueueTest"); frame.setSize(300, 200);// ww w . j a v a 2s. c o m frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); Container contentPane = frame.getContentPane(); contentPane.add(new EventQueuePanel()); frame.show(); }
From source file:ToolBarTest.java
public static void main(String args[]) { JFrame frame = new JFrame(); Container contentPane = frame.getContentPane(); JToolBar bar;/*from w w w . j a v a 2s. c o m*/ bar = new JToolBar(); JToggleButton jb; for (int i = 0; i < 8; i++) { jb = new JToggleButton("" + i); bar.add(jb); if (i == 5) { bar.addSeparator(); } } contentPane.add(bar, BorderLayout.NORTH); frame.setSize(300, 300); frame.show(); }
From source file:Clock.java
public static void main(String[] a) { JFrame f = new JFrame(); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0);/*from w w w.ja va 2 s .c om*/ } }); Clock c = new Clock(); f.getContentPane().add("Center", c); f.pack(); f.setSize(new Dimension(300, 300)); f.show(); }