0% found this document useful (0 votes)
17 views3 pages

Ajp Exp 2 Op

Uploaded by

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

Ajp Exp 2 Op

Uploaded by

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

X.

Practical Code:

1. Write Java Program to show the give output (Refer Manual pg. no. 7) :

import java.awt.*;
public class ListDemo{
public static void main(String[] args) {
Frame f1 = new Frame("Exp 2");
f1.setLayout(new GridLayout(12,1));
Label n2 = new Label("Choose your favourite Season: ");
List l1 = new List(3, false);
l1.add("Summer");
l1.add("Winter");
l1.add("Rainy");
l1.add("Autumn");
l1.add("Spring");

f1.add(n2);
f1.add(l1);
f1.setVisible(true);
f1.setSize(400, 300);
}
}
XIII Exercise:

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

import java.awt.*;
import java.net.*;
import java.util.Date;
public class RadioButtonDemo{
public static void main(String[] args) {
Frame f1 = new Frame("Exp 2");
f1.setLayout(new GridLayout(12,1));
Label n2 = new Label("Choose your City: ");
List l1 = new List(10, false);
l1.add("Mumbai");
l1.add("Delhi");
l1.add("Pune");
l1.add("Patna");
l1.add("Kolkata");
l1.add("Chennai");
l1.add("Bengaluru");
l1.add("Amritsar");
l1.add("Mirzapur");
l1.add("Nagpur");

f1.add(n2);
f1.add(l1);
f1.setVisible(true);
f1.setSize(400, 300);

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

import java.awt.*;
import java.net.*;
import java.util.Date;
public class RadioButtonDemo{
public static void main(String[] args) {
Frame f1 = new Frame("Exp 2");
f1.setLayout(new GridLayout(12,1));
Label n2 = new Label("Choose your Favourite Newspaper: ");
Choice l1 = new Choice();
l1.add("Times of India");
l1.add("Hindustan Times");
l1.add("Mid-Day");
l1.add("The Economic Times");

f1.add(n2);
f1.add(l1);
f1.add(n1);
f1.add(n);
f1.add(d);
f1.add(i);
f1.setVisible(true);
f1.setSize(400, 300);

}
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy