import java.awt.*;
class Frame5
{
Frame f;
TextField tf;
Button b;
Label l;
Frame5(String s)
{
f=new Frame(s);
l=new Label("Enter");
l.setBounds(20,40,80,20);
f.add(l);
tf=new TextField();
tf.setBounds(50,70,250,25);
f.add(tf);
b=new Button("Ok");
b.setBounds(65,100,40,40);
f.add(b);
f.setLayout(null);
f.setSize(400,400);
f.setVisible(true);
}
public static void main(String surat[])
{
new Frame5("Frame");
}
}
Output:
class Frame5
{
Frame f;
TextField tf;
Button b;
Label l;
Frame5(String s)
{
f=new Frame(s);
l=new Label("Enter");
l.setBounds(20,40,80,20);
f.add(l);
tf=new TextField();
tf.setBounds(50,70,250,25);
f.add(tf);
b=new Button("Ok");
b.setBounds(65,100,40,40);
f.add(b);
f.setLayout(null);
f.setSize(400,400);
f.setVisible(true);
}
public static void main(String surat[])
{
new Frame5("Frame");
}
}
Output:
No comments:
Post a Comment