Example usage for java.awt Frame setVisible

List of usage examples for java.awt Frame setVisible

Introduction

In this page you can find the example usage for java.awt Frame 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:flushMe.java

public static void main(String[] args) {
    Frame f = new flushMe();
    f.setVisible(true);
}

From source file:Main.java

public static void main(String[] args) {
    Frame f = new Main("BorderLayout demo");
    f.pack();/* w  ww  .ja v  a 2s.co  m*/
    f.setVisible(true);
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    Frame frame = new Frame();

    frame.setSize(300, 300);/*from  ww w .j  a  va2 s . c  om*/
    frame.setVisible(true);

    deiconify(frame);
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    Frame frame = new Frame();

    frame.setSize(300, 300);//from w ww . ja v a 2 s .c  o  m
    frame.setVisible(true);

    minimize(frame);
}

From source file:Main.java

public static void main(String[] args) {
    Frame f = new Main();
    f.setVisible(true);
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    Frame frame = new Frame();

    frame.setSize(300, 300);/*from  w w w.  ja va 2  s .  c o m*/
    frame.setVisible(true);

    maximize(frame);

}

From source file:ClassForName.java

public static void main(String[] av) {
    Class c = null;/*ww w.jav  a2 s . co m*/
    Object o = null;
    try {
        // Load the class, return a Class for it
        c = Class.forName("java.awt.Frame");
        // Construct an object, as if new Type()
        o = c.newInstance();
    } catch (Exception e) {
        System.err.println("That didn't work. " + " Try something else" + e);
    }
    if (o != null && o instanceof Frame) {
        Frame f = (Frame) o;
        f.setTitle("Testing");
        f.setVisible(true);
    } else
        throw new IllegalArgumentException("Huh? What gives?");
}

From source file:Main.java

public static void main(String args[]) {
    Frame f = new Frame();
    JPanel mgb = new Main();
    f.add("Center", mgb);
    f.pack();// ww  w.j  a  v a 2s  . c o m
    f.setSize(300, 300);
    f.setVisible(true);
}

From source file:Main.java

public static void main(String[] args) throws HeadlessException, AWTException {
    Frame frame = new Frame();
    Button button1 = new Button("Ok");
    frame.add(button1, BorderLayout.NORTH);
    frame.setSize(50, 55);/*from   ww w. ja  v a 2  s .co m*/
    frame.setVisible(true);

    button1.setCursor(Cursor.getSystemCustomCursor("MoveDrop.32x32"));
}

From source file:Main.java

public static void main(String args[]) throws Exception {
    // Create a test frame
    Frame frame = new Frame("Hello");
    frame.add(new Label("Minimize demo"));
    frame.pack();//w  ww  .  ja  v a  2s . c o m

    // Show the frame
    frame.setVisible(true);

    // Sleep for 5 seconds, then minimize
    Thread.sleep(5000);
    frame.setState(Frame.ICONIFIED);
    frame.setVisible(false);
    // Sleep for 5 seconds, then restore
    Thread.sleep(5000);
    frame.setState(Frame.NORMAL);
    frame.setVisible(true);

    // Sleep for 5 seconds, then kill window
    Thread.sleep(5000);
    frame.setVisible(false);
    frame.dispose();

    // Terminate test
    System.exit(0);
}