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

Ajp 2

The document contains two Java classes, Exp2_XIII1 and Exp2_XIII2, which create GUI frames displaying lists of cities in Maharashtra and newspapers, respectively. Each class sets up a frame with a specific title, dimensions, and a list component populated with items. The classes are designed to be executed independently, with each having a main method to launch the GUI.

Uploaded by

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

Ajp 2

The document contains two Java classes, Exp2_XIII1 and Exp2_XIII2, which create GUI frames displaying lists of cities in Maharashtra and newspapers, respectively. Each class sets up a frame with a specific title, dimensions, and a list component populated with items. The classes are designed to be executed independently, with each having a main method to launch the GUI.

Uploaded by

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

import java.awt.

*;

class Exp2_XIII1 extends Frame {


List cityList;

Exp2_XIII1() {
setLayout(null);
setSize(300, 300);
setTitle("City List in Maharashtra");
setVisible(true);

cityList = new List(10, false);


cityList.add("Mumbai");
cityList.add("Pune");
cityList.add("Nagpur");
cityList.add("Nashik");
cityList.add("Aurangabad");
cityList.add("Kolhapur");
cityList.add("Solapur");
cityList.add("Thane");
cityList.add("Jalgaon");
cityList.add("Akola");

cityList.setBounds(50, 50, 200, 200);


add(cityList);
}

public static void main(String[] args) {


new Exp2_XIII1();
}
}
import java.awt.*;

class Exp2_XIII2 extends Frame {


List newspaperList;

Exp2_XIII2() {
setLayout(null);
setSize(300, 300);
setTitle("Newspapers");
setVisible(true);

newspaperList = new List(10, true);


newspaperList.add("The Times of India");
newspaperList.add("The Hindu");
newspaperList.add("The Indian Express");
newspaperList.add("Hindustan Times");

newspaperList.setBounds(50, 50, 200, 200);


add(newspaperList);
}

public static void main(String[] args) {


new Exp2_XIII2();
}
}

You might also like