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

public static void main(String[] args) {
    JFrame f = new JFrame();
    f.getContentPane().add(new RoundGradientPaintFill());
    f.setSize(200, 200);// w  ww .j a  va2 s.  c  om
    f.show();
}

From source file:TransformersRotationTranslation.java

public static void main(String[] a) {
    JFrame f = new JFrame();
    f.getContentPane().add(new TransformersRotationTranslation());
    f.setSize(350, 450);/*w ww  .  jav a  2s  .  co m*/
    f.show();
}

From source file:JNLPTest.java

public static void main(String args[]) {
    JFrame frame = new JFrame();
    Container content = frame.getContentPane();
    JLabel label = new JLabel("Hello, JNLP");
    content.add(label, BorderLayout.CENTER);
    frame.setSize(200, 200);//from   ww w  . jav  a2s .  c  om
    frame.show();
    try {
        Thread.sleep(5000);
    } catch (InterruptedException ignored) {
    } finally {
        System.exit(0);
    }
}

From source file:ButtonTipTest.java

public static void main(String args[]) {
    JFrame frame = new JFrame("Tool Tips");
    Container contentPane = frame.getContentPane();
    JButton b = new JButton("Button");
    b.setToolTipText("Go Away");
    contentPane.add(b, BorderLayout.NORTH);
    frame.setSize(300, 200);/*from  w ww . j  a v a  2 s . c  o m*/
    frame.show();
}

From source file:WindowAdapterTest.java

public static void main(String args[]) {
    JFrame frame = new JFrame("Window Listener");
    WindowListener listener = new WindowAdapter() {
        public void windowClosing(WindowEvent w) {
            System.exit(0);/*from   w w w  .j  a v a 2s.  c  o m*/
        }
    };
    frame.addWindowListener(listener);
    frame.setSize(300, 300);
    frame.show();
}

From source file:EnhancedFileTester.java

public static void main(String args[]) {
    JFrame f = new JFrame("Enhanced File Example");
    JPanel j = new EnhancedFileTester();
    f.getContentPane().add(j, BorderLayout.CENTER);
    f.setSize(300, 200);/*from  w ww  . j  a  va 2 s. c o  m*/
    f.show();
}

From source file:Main.java

public static void main(String args[]) {
    JFrame frame = new JFrame("Fourth Button");
    Container contentPane = frame.getContentPane();
    JButton b = new JButton("Button!");
    Border bored = BorderFactory.createLineBorder(Color.RED);
    b.setBorder(bored);/*from w  w  w. ja v a 2s . c  om*/
    contentPane.add(b, BorderLayout.CENTER);
    frame.setSize(350, 200);
    frame.show();
}

From source file:LabelForComboBox.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  ww.  jav a  2 s  .  c om*/
        }
    });
    f.getContentPane().add(new LabelForComboBox());
    f.pack();
    f.setSize(new Dimension(300, 200));
    f.show();

}

From source file:CheckBoxMnemonic.java

public static void main(String[] a) {
    JFrame f = new JFrame();
    f.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);//from  www.j  ava  2 s .  c  o  m
        }
    });
    f.getContentPane().add(new CheckBoxMnemonic());
    f.pack();
    f.setSize(new Dimension(300, 200));
    f.show();

}

From source file:ColorComboRenderer.java

public static void main(String[] a) {
    JComboBox cbColor = new JComboBox();
    int[] values = new int[] { 0, 128, 192, 255 };
    for (int r = 0; r < values.length; r++)
        for (int g = 0; g < values.length; g++)
            for (int b = 0; b < values.length; b++) {
                Color c = new Color(values[r], values[g], values[b]);
                cbColor.addItem(c);//ww  w. j a  v a2 s  . c  o  m
            }
    cbColor.setRenderer(new ColorComboRenderer());

    JFrame f = new JFrame();
    f.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);
        }
    });
    f.getContentPane().add(cbColor);
    f.pack();
    f.setSize(new Dimension(300, 80));
    f.show();

}