wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

JAVA QUIZ

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Which Swing control allows placement of formatted text information on a frame and uses a text property?

a)

JLabel

b)

JTextField

c)

JTextArea

d)

JEditorPane

2.

Which control accepts a single line of typed information from the user?

a)

JTextArea

b)

JTextField

c)

JLabel

d)

JList

3.

Which Swing control is designed to accept multiple lines of scrollable typed information?

a)

JTextField

b)

JTextArea

c)

JLabel

d)

JPasswordField

4.

What is the typical use of a JCheckBox in a Swing application?

a)

To select one option from a mutually exclusive group

b)

To provide a yes or no answer to a question

c)

To present a drop-down list of items

d)

To display static text captions

5.

How does a JRadioButton differ from a JCheckBox according to the description?

a)

Radio buttons accept text input, check boxes do not

b)

Radio buttons are used in mutually exclusive groups, check boxes are independent

c)

Radio buttons display formatted text, check boxes display icons

d)

Radio buttons create scroll bars, check boxes create lists

6.

Which control provides a drop-down list from which users can choose an item such as a state or country?

a)

JList

b)

JComboBox

c)

JMenu

d)

JTable

7.

Which statement accurately describes JList based on the provided material?

a)

It is a drop-down control that allows only single selection

b)

It is a list with the list portion always visible and supports multiple selections

c)

It is a single-line text input field

d)

It is a formatted text label used for captions

8.

What is the role of a JScroll control as described in the material?

a)

To manage layout of components within a frame

b)

To select from a range of values and be buddied with a related control

c)

To trigger actions like a button

d)

To group mutually exclusive options

9.

Select all controls from the list that accept user-typed text input.

a)

JLabel

b)

JTextField

c)

JTextArea

d)

JButton

10.

What is the primary function of a JComboBox in a Swing application?

a)

To show static text information

b)

To create a button that performs an action

c)

To allow users to input multiple lines of text

d)

To display a list of items for selection