Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
1K views

Name: Manish Kumhar Class: Tyco-A Roll No: 43 Subject: Ajp (Experiment: 2)

This document contains details of a practical assignment completed by student Manish Kumhar of class TYCO-A. The assignment involved writing a program to design a form using Java Swing List and Choice components. The program displays a list of 10 cities and allows multiple selections from a list of newspapers. Key aspects covered include the purpose of the practical, relevant learning outcomes, theoretical background on List and Choice, sample program codes and outputs. The document assessments the performance based on logic, debugging, output and timely submission.

Uploaded by

Manish Kumhar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

Name: Manish Kumhar Class: Tyco-A Roll No: 43 Subject: Ajp (Experiment: 2)

This document contains details of a practical assignment completed by student Manish Kumhar of class TYCO-A. The assignment involved writing a program to design a form using Java Swing List and Choice components. The program displays a list of 10 cities and allows multiple selections from a list of newspapers. Key aspects covered include the purpose of the practical, relevant learning outcomes, theoretical background on List and Choice, sample program codes and outputs. The document assessments the performance based on logic, debugging, output and timely submission.

Uploaded by

Manish Kumhar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

NAME: MANISH KUMHAR

CLASS: TYCO-A
ROLL NO: 43
SUBJECT: AJP (EXPERIMENT: 2)
Practical No. 2: Write a program to design a form using the
components List and Choice.

I. Practical Significance:
The List and Choice components lets the user choose one option from list of available options A
Choice is displayed in a compact form that requires you to pull it down to see the list of available
choices. Only one item may be selected from a Choice. A List may be displayed in such a way that
several List items are visible. A List supports the selection of one or more List items.

II. Relevant Program Outcomes (POs)


 Basic knowledge: Apply knowledge of basic mathematics, sciences and basic engineering to
solve the computer group related problems.
 Discipline knowledge: Apply Computer Programming knowledge to solve the computer group
related problems.
 Experiments and practice: Plan to perform experiments and practices to use the results to solve
the computer group related problems.
 Engineering tools: Apply relevant Computer programming / technologies and tools with an
understanding of the limitations.
 Individual and Team work: Function effectively as a leader and team member in
diverse/multidisciplinary teams.
 Communication: Communicate effectively in oral and written form.

III. Competency and Practical skills


To develop standalone applications and web Application The practical
is expected to develop the following skills:
1. Able to develop an applet/application using Choice and List components.

IV. Relevant Course Outcome(s)


Develop programs using GUI Framework (AWT and Swing).

V. Practical Outcome (PrOs)


Write a program to design a form using the components List and Choice .

VI. Relevant Affective domain related Outcome(s)


1. Follow precautionary measures.
2. Follow naming conventions.
3. Follow ethical practices.

VII. Minimum Theoretical Background

List: Creates a list from which the user can choose list items.

Constructors:
List () // allows only one item to be selected
List (int numRows) // no of entries will always be visible
List (int numRows, Boolean multiple Select)// if it is true then user select multiple
items. If it is false then only one item may be selected
Choice
The Choice class is used to create a pop-up list of items from which the user may choose.
When the user clicks on it, the whole list of choices pops up and new selection can be made.
Choice defines the default constructor, which creates an empty list. To add a selection to the
list, call add ().

VIII. Resources required (Additional) –

Nil

IX. Resources used (Additional)

Sr. Name of
Broad Specification Quantity Remarks (If any)
No. Resource
1
2

X. Program Code: Teacher must assign a separate program statement to group of 3-4 students.
1. Write Java Program to show following output.

Figure 1

XI. Result (Output of Code):

...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
......................................................................................
Program:-
import java.awt.*;
public class Season
{
Season() {
Frame f = new Frame("Manish Kumhar 43");
List l1 = new List(3, true);
l1.setBounds(100, 70, 100, 70);
l1.add("Summer");
l1.add("Winter");
l1.add("Rainy");
f.add(l1);
f.setSize(300,200);
f.setLayout(null);
f.setVisible(true);
}
public static void main(String args[])
{
Season s = new Season();
}
}

Output:-
XII. Practical Related Questions
Note: Below given are few sample questions for reference. Teacher must design more such
questions so as to ensure the achievement of identified CO.
1. Write the name of components used in following output

2. State the difference between List and Choice control


3. Write the use of getSelectedItem() and getSelectedIndex() for List.

(Space for answer)

.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
XIII. Exercise:
1. Develop an applet/ application using List components to add names of 10 different cities.
Program:-
import java.awt.*;
public class Cities
{
Cities()
{
Frame f = new Frame("Manish Kumhar 43");
List l1 = new List(5);
l1.setBounds(100, 100, 100, 120);
l1.add("Mumbai");
l1.add("Bangalore");
l1.add("Delhi");
l1.add("Hyderabad");
l1.add("Ahmedabad");
l1.add("Jaipur");
l1.add("Chennai");
l1.add("Nagpur");
l1.add("Thane");
l1.add("Pune");
f.add(l1);
f.setSize(300, 300);
f.setLayout(null);
f.setVisible(true);
}
public static void main(String args[])
{
Cities s = new Cities();
}
}
Output:-
2. Develop applet / application to select multiple names of news papers
Program:-
import java.awt.*;
public class NewsPaper
{
NewsPaper()
{
Frame f = new Frame("Manish Kumhar 43");
List l1 = new List(7,true);
l1.setBounds(100, 100, 100, 120);
l1.add("Times Of India");
l1.add("Hindustan Times");
l1.add("The Telegraph");
l1.add("Deccan Chronicle");
l1.add("Mumbai Mirror");
l1.add("The New India Express");
l1.add("The Economic Times");
f.add(l1);
f.setSize(300, 300);
f.setLayout(null);
f.setVisible(true);
}
public static void main(String args[])
{
NewsPaper s = new NewsPaper();
}
}
Output:-
XIV. References/ Suggestions for Further Reading
1. https://www.javatpoint.com
2. https://www.tutorialspoint.com/java
3. The complete reference Java 2 by Herbert schildt

XV. Assessment Scheme

Performance Indicators Weightage


Process related (35 Marks) 70%
1. Logic formation 30%
2. Debugging ability 30%
3. Follow ethical practices 10%
Product related (15 Marks) 30%
4. Expected output 10%
5. Timely Submission 10%
6. Answer to sample questions 10%
Total (50 Marks) 100%

List of Students /Team Members

1. …………………………………..
2. …………………………………..
3. …………………………………..

Dated signature of
Marks Obtained
Teacher

Process Product
Total(50)
Related(35) Related(15)

You might also like