xxxxxxxxxx
import java.awt.*;
public class MyFrame extends Frame {
public MyFrame() {
// Set title
super("My Frame");
// Set size
setSize(400, 300);
// Set layout
setLayout(new FlowLayout());
// Add components
add(new Label("Hello, AWT!"));
// Make frame visible
setVisible(true);
}
public static void main(String[] args) {
new MyFrame();
}
}