>Program Code:
Write Java Program to show following output.
import java.awt.*;
public class question6 {
public static void main(String args[])
{
Frame f=new Frame();
f.setSize(500,500);
f.setLayout(new FlowLayout());
f.setVisible(true);
List l=new List(4);
f.add(l);
l.add("Summer");
l.add("Winter");
l.add("Rainy");
}
}
>Exercise:
1.Develop an applet/application using List components to add names of 10
different cities.
import java.awt.*;
public class question7 {
public static void main(String args[])
{
Frame f=new Frame();
f.setSize(500,500);
f.setLayout(new FlowLayout());
f.setVisible(true);
List l=new List(7,true);
f.add(l);
l.add("Karad");
l.add("Kolhapur");
l.add("Pune");
l.add("Mumbai");
l.add("Kolkata");
MADHURA MAHESH INGAWALE 2251
l.add("Nagpur");
l.add("Latur");
l.add("Nashik");
l.add("Belgaon");
l.add("Beed");
}
}
Output:
2.Develop applet/application to select multiple names of news papers.
import java.awt.*;
public class question8 {
public static void main(String args[])
{
Frame f=new Frame();
f.setSize(500,500);
f.setLayout(new FlowLayout());
f.setVisible(true);
List l=new List(4,true);
f.add(l);
l.add("Pudhari");
l.add("Lokmat");
l.add("Sakal");
l.add("Loksatta");
l.add("Agrowan");
l.add("Punyanagari");
}
MADHURA MAHESH INGAWALE 2251
Output:
MADHURA MAHESH INGAWALE 2251
MADHURA MAHESH INGAWALE 2251