Simple GUI AWT Frame

import java.awt.*;
class MyFrame extends Frame {
private Button myb;
MyFrame() {
myb = new Button("OK");
setLayout(new FlowLayout());
add(myb);
setSize(200,300);
setTitle("First Frame");
setVisible(true);
}

}
public class MyFirstFrame  {


public static void main(String args[])
{
// MyFrame f = new MyFrame();
new MyFrame();
}

}

Comments

Popular posts from this blog

Custom Exception example for BankAccount

HashMap HashSet example

Annotation