Button1.java
Aim:
To display a Button using AWT Frame.
Source code:
import java.awt.*;
public class Button1
{
public static void main(String args[])
{
Frame f=new Frame("Button Example");
Button b=new Button("Submit");
b.setBounds(100,100,150,80);
f.add(b);
f.setSize(500,500);
f.setLayout(null);
f.setVisible(true);
}
}
Output:
No comments:
Post a Comment