0

Test 1 Java Swings

Description: This quiz is based on Swings
Number of Questions: 15
Created by:
Tags: Swings Java programming
Attempted 0/15 Correct 0 Score 0

Which of the following classes in Java contains swing version of an applet?

  1. JButton

  2. JCheckBox

  3. JApplet

  4. AbstractButton

  5. JLabel


Correct Option: C
Explanation:

This class in java contains swing version of applet.

Which of the following statements is must in a Java program for creating a frame?

  1. import java.awt.*;

  2. import java.awt.event.*;

  3. import java.awt.frame;

  4. 1, 2 and 3

  5. only 1 and 2


Correct Option: D
Explanation:

Option 3 is also required. This option is correct.

Which of the following align arguments is not available in Java to be used in SwingConstants interface?

  1. Left

  2. Right

  3. Middle

  4. Leading

  5. Trailing


Correct Option: C
Explanation:

This align argument is not available in Java to be used in SwingConstants interface.

Which of the following classes of Java swing extends Applet class?

  1. JButton

  2. JApplet

  3. AbstractButton

  4. None of these


Correct Option: B
Explanation:

This class of Java swing extends Applet class.

In Java swing, which of the following components is/are represented by a rectangular area in which a component may be viewed?

  1. Scroll pane

  2. Tabbed pane

  3. Combo boxes

  4. None of these


Correct Option: A
Explanation:

This component in Java swing is represented by a rectangular area in which a component may be viewed.

Which of the following classes in java.awt package describes a graphics device such as a screen or printer?

  1. Canvas

  2. GraphicsDevice

  3. Frame

  4. None of these


Correct Option: B
Explanation:

This class in java.awt package describes a graphics device such as a screen or printer.

What is not true for a Java bean?

  1. There are no public instance variables.

  2. All persistent values are accessed using getxxx and setxxx methods.

  3. It may have many constructors as necessary.

  4. All of the above are true of a Java bean.


Correct Option: C

What is invoked via HTTP on the Web server computer when it responds to requests from a user's Web browser?

  1. A Java application

  2. A Java applet

  3. A Java servlet

  4. None of these


Correct Option: C

Which component of an event is the object that generates the event?

  1. Event object

  2. Event source

  3. Event handler

  4. None of these


Correct Option: B
Explanation:

Event source is an object that generates an event.

_________ is generated when a button is pressed, a list item is double-clicked or a menu item is selected.

  1. Action Event

  2. Adjustment Event

  3. Component Event

  4. Container Event


Correct Option: A
Explanation:

Action EventĀ is generated when a button is pressed, a list item is double-clicked or a menu item is selected.

Which of the following events is generated when the size, position or visibility of a component is changed?

  1. Adjustment Event

  2. Component Event

  3. Container Event

  4. Item Event


Correct Option: B
Explanation:

Component Event is generated when the size, position or visibility of a component is changed.

To create swing components, which of the following is imported?

  1. javax.awt.*

  2. java.awt.*

  3. javax.swing.*

  4. java.swing.*


Correct Option: C

Which event is generated when a checkbox or a list item is clicked or when a check menu item is selected or deselected?

  1. Container Event

  2. Component Event

  3. Focus Event

  4. Item Event


Correct Option: D
Explanation:

Item Event is generated when a check box or a item list is clicked or when a check menu item is selected or deselected.

Swing elements are preceded by the letter

  1. S

  2. A

  3. X

  4. J


Correct Option: D

Which of the following user interfaces defines how should components be arranged in a container?

  1. Component

  2. Container

  3. Layout manager

  4. None of these


Correct Option: C
Explanation:

Layout manager defines how the components will be arranged in a container.

- Hide questions