Design
an applet/application to create form using Text Field, Text Area, Button and
Label.
Label 1
name : Enter your name
Lable 2
name : Adress
Button
: submit
package com.javaguides.javaswing.login;
import java.awt.*;
public class BasicAWT
{
public static void main(String args[])
{
Frame f = new Frame();
f.setSize(400,400);
f.setVisible(true);
f.setLayout(new FlowLayout() );
Label l1 = new Label();
l1.setText("Enter Your Name ");
TextField tf = new TextField(" enter name");
Label l2 = new Label("Address");
TextArea ta = new TextArea("",3,40);
Button b = new Button("Submit");
f.add(l1); f.add(tf); f.add(l2); f.add(ta); f.add(b);
}
}
output:
No comments:
Post a Comment