You are on page 1of 3

Experiment No 2:- Write a program to design a form using the components List an Choice.

Q1. Write a program to show the following output

Q2. Write the name of components used in following output


Experiment No 2:- Write a program to design a form using the components List an Choice.

Q3. State the difference between List and Choice control.


Choice : - A Choice is displayed in a compact form that requires you to pull it down
to see the list of available choices. Only one item may be selected from a
Choice.Choice is the act of picking or deciding between two or more
possibilities.Only one item may be selected from a choice.
Experiment No 2:- Write a program to design a form using the components List an Choice.

List : - A List may be displayed in such a way that several List items are visible. A
List supports the selection of one or more List items.A list is any enumeration of a
set of items. A List supports the selection of one or more list items.

Q4. Write the use of getSelectedItem() and


getSelectedIndex() for List control.
The getSelectedIndexes() method returns an integer array of the selected items. If nothing is
selected, the array will be empty. The getSelectedItem() method returns the label of the
selected item. The label is the string used in the add() or addItem() call.

Q5. Develop applet/application to select multiple names of


newspapers.

Q6. Develop an applet/application using List components to add


names of 10 different cities.

You might also like