Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.awt.*;
- public class test extends Frame {
- test() {
- Button b = new Button("Click Me!!");
- b.setBounds(200, 100, 500, 30);
- //adding button into frame
- add(b);
- // frame size 300 width and 300 height
- setSize(900, 900);
- // setting the title of Frame
- setTitle("This is our basic AWT example");
- // no layout manager
- setLayout(null);
- // now frame will be visible, by default it is not visible
- setVisible(true);
- }
- public static void main(String[] args) {
- test f = new test ();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement