import java.awt.*;
class drawFrame extends Frame{
drawFrame() {
Button b = new Button("Click me!");
b.setBounds(30,100,80,30); //setting button position
add(b); //adding button into frame
setLayout(null);
setSize(400,400);
setLocation(500,350);
setTitle("Hungry4java");
setVisible(true);
}
public static void main(String[] args) {
drawFrame f = new drawFrame();
}
}
No comments:
Post a Comment