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

 

Sr.

No.

Name of Resource

Broad Specification

Quantity

Remarks

(If any)

1

Computer System

Computer (i3-i5 preferable RAM > 2GB

 

As per Batch Size

 

 For All Experiments

2

Operating System

Windows/Linux

3

Development Software

JDK 1.5 Onwards

 

 X.   Program Code: Teacher must assign a separate program            statement to group of  3-4 students.

1. Write Java Program to show following output.

                 


Code:-

     



Comments