You are on page 1of 4

Name of Student: Ekambe Ganesh Roll No.

: 53

Experiment No.: 02 DOS:

Exercise:

1. Develop an applet/ application using List components to add names of


10 different cities.
import java.awt.*;

public class Demo_list1


{
public static void main(String[] args)
{
int i;
Frame fr=new Frame("This Program is for Displaying the List");
fr.setSize(400,300);
fr.setLayout(new FlowLayout());
fr.setVisible(true);
List Cities=new List(10,false);
Cities.add("Udgir");
Cities.add("Latur");
Cities.add("Nanded");
Cities.add(" Loha");
Cities.add(" Nilanga");
Cities.add(" Yavatmal");
Cities.add(" Hingoli");
Cities.add(" akola");
Cities.add(" Shiradi");
Cities.add(" Parbhani");
fr.add(Cities);
}

}
Name of Student: Ekambe Ganesh Roll No.: 53

Experiment No.: 02 DOS:

Output
Name of Student: Ekambe Ganesh Roll No.: 53

Experiment No.: 02 DOS:

2. Develop applet / application to select multiple names of news papers

import java.awt.*;

public class Newspaper


{

public static void main(String[] args)


{
Frame fr=new Frame("News Paper");
fr.setSize(400,300);
fr.setLayout(new FlowLayout());
fr.setVisible(true);
List news=new List(10,true);
news.add("Lokmat");
news.add("Sakal");
news.add("Punya Nagari");
news.add("Aapal Latur");
news.add("Hello Latur");
news.add("Kesari");
news.add("Hindustan");
fr.add(news);
}

}
Name of Student: Ekambe Ganesh Roll No.: 53

Experiment No.: 02 DOS:

Output

You might also like