Vous êtes sur la page 1sur 2

Question Bank: Practical no.

12 AJP (TYIF)
Title: Swing Components: JButton, JTextField,
JComboBox, JCheckBox and JRadioButton

1. Display four different buttons on the applet with different icons. When you
click any one of these buttons the icon associated with it will get changed.
2. Display a button and a label with icon. Foe every click of the button the icon
will get changed.
3. Create a default icon, which will be applied to only one radio button at a
time, out of four. It is decided by your click on that radio button.
4. Display 10 different radio buttons on the applet. They are associated with 10
different alphabets. When you click on these radio buttons, the string will be
formed by every click and it will be displayed on the status bar. It is jus like
the typing alphabets from the keyboard.
5. Create a text field, two radio buttons (‘ON’ and ‘OFF’), a button and a combo
box. When you enter the text field, after pressing button it will get inserted
in the combo box. The status of radio button decides whether it is enabled or
disabled.
6. Display a combo box with 10 different alphabets. You need to select a
alphabet at a time. After every selection made on the combo box, the string
will be formed and get displayed on the text field near to it. It is just like the
keyboard.
7. Display five check boxes with different names on the applet. We need to
select any number of checkboxes at a time. The status bar will display how
many numbers of checkboxes are selected true on the applet.
8. Display five different radio buttons on the applet and change the icon of the
label as per the selection made on the radio button.
9. Display a combo box on the applet. Add any five items in it. Display a button
named ‘Remove’ near to it. When you click onto it, the selected item will get
removed from combo box. After the combo box is empty, the status bar will
flash the same message on it.
10. Change the background color of the applet as per the selection made from
combo box items. The status bar will display the current selected color.
11. Change the background color of the applet as per the selection made from
radio button items. The status bar will display the current selected color.
12. Display a text field, a button and a check box on the applet. When you click
onto the button, the text from text field will get set as the label on the check
box.
13. Display four different text boxes and buttons on the applet. Every text box is
associated with appropriate button. When you click any of these buttons, the
text of the associated text box will get displayed on the status bar.
14. Display a combo box and a group of five radio buttons on applet. When the
selection of both is made, the concatenated string of both selected items will
get displayed in the text field.
15. Five different icons are associated with five different check boxes. Display
the icons only those check boxes whose current state is true.
16. A group of five radio buttons and combo box of five items is displayed on the
applet. Both will contain same strings in same sequence. The current

Practical No. 12 (AJP) -1-


selected string of radio button will get displayed ‘disabled’ always when the
selection is made.
17. Display two groups of five radio buttons on the applet. They will contain the
numbers associated with them. The text field near to them will contain the
multiplication of numbers from both selected radio buttons.
18. Display two combo boxes on the applet. They will contain the numbers
associated with them. The text field near to them will contain the
multiplication of numbers from both selected combo boxes.
19. Display five different check boxes on the applet. Create five different labeled
icons with a number as image (use paint for this). When you select the
check boxes from these, the total number of selected check boxes will be
displayed as the image icon.
20. Display five check boxes and radio buttons on the applet. They will contain
the same names in same sequence. When you make selection from the radio
button, the respective check box will also get selected and other will be
deselected.

----------------

Mr. Kute T. B.
(Subject Teacher)

Practical No. 12 (AJP) -2-

Vous aimerez peut-être aussi