Monday 20 April 2015

JAVA-AWT -Example

Package awtexample;

import java.awt.*;

public class awt1

{

public static void main(String []args)

{
myframe f=new myframe("notepad");

}

}

class myframe  extends Frame

{

Label l;

TextField tf;

Button b;

Panel p;

myframe(String s)

{
super(s);
p=new Panel();
l=new Label("Enter UserName");
p.add(l);
tf=new TextField(10);
p.add(tf);

b=new Button("login");
p.add(b);

add(p);

setSize(400,400);

setVisible(true);

}
}

No comments:

Post a Comment