Pratical 2
Pratical 2
2
Aim:- Write a program to design a form using the components List and Choice
Program :-
import java.awt.*;
public class LISTCHOICE
{
public static void main(String args[])
{
Frame f = new Frame("LISTCHOICE");
Label label = new Label("Select the sweet : ");
List l = new List();
l.add("Chocolate");
l.add("Icecream");
l.add("Waffles");
l.add("Kheer");
l.add("Kalakand");
f.add(label);
f.add(l);
f.add(L);
f.add(c);
f.setVisible(true);
f.setSize(400,400);
f.setLayout(new FlowLayout());
}
}
Output:-