0% found this document useful (0 votes)
913 views2 pages

Program 2.1 //develop Applet/application Using List Component To Add of 10 Diffferent Cities

This program develops an applet that uses a list component to add 10 different Indian cities. It imports the necessary Java classes, creates a List object with space for 10 items and the ability to select multiple items. It then adds the city names "Nashik", "Pune", "Mumbai", "Nanded", "Sinner", "Jalgaon", "Dhule", "AhmedNagar", "Nandurbar", and "Buldhana" to the list. Finally, it adds the list to the applet display.

Uploaded by

rohitchavan2345
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
913 views2 pages

Program 2.1 //develop Applet/application Using List Component To Add of 10 Diffferent Cities

This program develops an applet that uses a list component to add 10 different Indian cities. It imports the necessary Java classes, creates a List object with space for 10 items and the ability to select multiple items. It then adds the city names "Nashik", "Pune", "Mumbai", "Nanded", "Sinner", "Jalgaon", "Dhule", "AhmedNagar", "Nandurbar", and "Buldhana" to the list. Finally, it adds the list to the applet display.

Uploaded by

rohitchavan2345
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 2

Program 2.

1
//develop applet/application using list component to add of 10 diffferent cities
import java.awt.*;
import java.applet.*;
public class Cities extends Applet
{
public void init()
{
List l1=new
List(10,true);
l1.add("Nashik");
l1.add("Pune");
l1.add("Mumbai");
l1.add("Nanded");
l1.add("Sinner");
l1.add("Jalgaon");
l1.add("Dhule");
l1.add("AhmedNagar")
; l1.add("Nandurbar");
l1.add("Buldhana");
add(l1);
}
}
/*<applet code="Cities.java" width=300 height=300></applet>*/

You might also like