Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Quiz 5: Java Swing

Total questions: 35

Worksheet time: 18mins

Name
Class
Date
1.

1. Which of the following architecture does the Swing framework use?

a)
  1. MVC

b)
  1. MVP

c)
  1. Layered architecture

d)
  1. Master-Slave architecture

2.

2. Which language is used in the swing framework?

a)
  1. JavaScript

b)
  1. Java

c)
  1. React

d)
  1. Python

3.

A ____ is the abstract foundation class for SWING's non-menu user interface controls?

a)
  1. Container

b)
  1. Jcomponent

c)
  1. Component

d)

None of the above

4.

A ____ is the basic class for all SWING UI components?

a)
  1. Container

b)
  1. Jcomponent

c)

Component

d)

None

5.

A ____ is a one-line input field that allows the user to choose a number or an object value from an ordered sequence?

a)
  1. JTextarea

b)
  1. Jtextfield

c)
  1. Jspinner

d)
  1. Jslider

6.

A ____ control is a dialogue window that allows the user to pick a file?

a)
  1. JChoosFile

b)
  1. JFilefield

c)
  1. JFile

d)
  1. JFileChooser

7.

An ____ is a change in the state of an item?

a)
  1. Spinner

b)
  1. Event

c)
  1. Occurrence

d)
  1. Activity

8.

How many types of events are there?

a)

5

b)

3

c)

2

d)

4

9.

Which of the following type of events requires direct interaction with the user?

a)
  1. Foreground events

b)

Background events

10.

Which of the following type of events requires direct interaction with the end-user?

a)
  1. Foreground events


b)
  1. Background events


11.

To manage events, Java employs the ____?

a)
  1. Custom-based Event Model

b)

Retired Event Model

c)
  1. Delegation Event Model


12.

Which of the following function is used to generate the application's top-level window?

a)
  1. JPanel

b)
  1. JFrame

c)
  1. JCombo

13.

____ is a container for other components and is used to build bespoke panels for organizing and arranging components?

a)
  1. JPanel

b)
  1. JFrame

c)
  1. JCombo

d)
  1. JBox

14.

Which of the following component gives a drop-down list of options from which to choose?

a)
  1. JPanel

b)
  1. JButton

c)
  1. JComboBox

d)
  1. JBox

15.

____ are classes that act as a connection point between event listeners and event sources?

a)
  1. Event adapters

b)
  1. Events Handler

c)
  1. Event listener

d)
  1. Jevent

16.

The ____ class serves as the foundation for all Swing components.

a)
  1. JButton

b)

JComponent

c)

JTextField

17.

In Swing, the ____ is used to render visuals and listen for events?

a)
  1. Event adapters


b)
  1. Events Handler


c)
  1. Event listener


d)
  1. Event-Driven Thread


18.

Among AWT and Swing which is platform independent?

a)
  1. AWT

b)
  1. Swing

19.

Swing framework is ____ component?

a)
  1. Heavyweight

b)
  1. Lightweight

20.

The ____ class enables the development of abstract functions as well as action interfaces.

a)
  1. Action

b)
  1. Abstraction

c)
  1. AbstractionAction


21.

____ is a data transfer class that provides an easy way to transport data from the Jcomponent.

a)
  1. DataShare

b)
  1. Transfer

c)
  1. DataTransfer

d)
  1. TransferHandler

22.

invokeandwait() method in Swing framework is ____.


a)
  1. Synchronous

b)
  1. Asynchronous

23.

invokelater() method in Swing framework is ____?

a)
  1. Synchronous

b)
  1. Asynchronous

24.

An ____ is a short software that runs in a web browser.

a)
  1. Application

b)
  1. AWT

c)
  1. Applet

d)
  1. JFrame

25.

Is Applet and Application both are same in the swing framework?

a)
  1. Yes

b)

No

26.

The act of turning the state of a Swing component or set of components into a stream of bytes that can be saved to a file or transferred over a network is referred to as ____ in Swing.

a)
  1. serialisation

b)
  1. Accessibility

c)
  1. Localization

d)
  1. Globalization

27.

A ____ is a Swing framework component that offers a scroll bar that may be used to scroll content in a container.

a)
  1. JScrollPanel

b)
  1. JScrollBox

c)
  1. JScroll

d)
  1. JScrollBar

28.

A ____ is a container that provides a viewport for showing a piece of a bigger component.

a)
  1. JScrollPanel

b)
  1. JScrollBox

c)
  1. JScroll

d)
  1. JScrollPane

29.

EDT in Swing framework stands for ____.

a)
  1. Event Driven thread

b)
  1. Event Determined Thread


c)
  1. Electronic-event-driven thread


30.

A ____ is a type of object that organizes components in a container.

a)
  1. Event adapter


b)
  1. Event Handler


c)
  1. layout manager


d)
  1. Grid Manager


31.

The ____ function allows you to paint with a Graphics object.

a)
  1. AllPaint()


b)
  1. Jpaint()


c)
  1. Repaint()


d)
  1. paint()


32.

Is Swing thread-safe?

a)

Yes

b)

No

33.

The ____ function is used to specify the layout of a container.

a)
  1. UseLayeout()


b)
  1. setLayout()


c)
  1. layout()


d)
  1. DesignLayout()


34.

____ method validates the components of a container.

a)
  1. Validate()


b)
  1. Examine()


c)
  1. Analyze()


35.

Which of the following companies are using swing framework?

a)
  1. IBM

b)
  1. Oracle


c)
  1. Microsoft


d)
  1. All of the above