Exam 14: Introduction to Swing Components

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Which method overrides the default behavior for the JFrame to be positioned in the upper-left corner of the computer screen's desktop?

(Multiple Choice)
4.9/5
(39)

You cannot change the font of strings displayed in GUI components.

(True/False)
4.8/5
(31)

A ____ consists of a label positioned beside a square; you can click the square to display or remove a check mark.

(Multiple Choice)
4.9/5
(41)

If a user enters more characters than specified in a JTextField , the extra characters are deleted.

(True/False)
4.8/5
(40)
Match each term with the correct statement below.
Premises:
A JTextField that has the capability of accepting keystrokes
Responses:
frame
lightweight components
heavyweight components
Correct Answer:
Verified
Premises:
Responses:
A JTextField that has the capability of accepting keystrokes
frame
(Matching)
4.7/5
(43)

Each Swing component is a descendant of a JComponent .

(True/False)
4.9/5
(35)

A component can be made available or unavailable by passing true or false to the ____ method.

(Multiple Choice)
4.8/5
(35)

When constructing a Font object, which of the following arguments is NOT required?

(Multiple Choice)
4.8/5
(28)

Which method sets the state of the JCheckBox to true for selected or false for unselected?

(Multiple Choice)
4.9/5
(41)
Match each term with the correct statement below.
Premises:
The measurement between lines of text in a single-spaced text document
Responses:
border layout manager
point size
container
Correct Answer:
Verified
Premises:
Responses:
The measurement between lines of text in a single-spaced text document
border layout manager
(Matching)
4.9/5
(34)

Write the statement to clear out a JTextField named myText .

(Short Answer)
4.9/5
(40)
Match each term with the correct statement below.
Premises:
A window with a title bar and border
Responses:
listener
heavyweight components
window decorations
Correct Answer:
Verified
Premises:
Responses:
A window with a title bar and border
listener
(Matching)
4.8/5
(39)

Swing  components are UI elements such as dialog boxes and buttons. You can usually recognize their names because they begin with ____.

(Multiple Choice)
4.8/5
(37)

Java provides you with a Font class from which you can create an object that holds typeface and size information.

(True/False)
4.9/5
(32)

import javax.swing.*; public class JFrameLook {     public static void main(String[] args)     {         ----Code here----         JFrame myFrame = new JFrame("Look and Feel");         myFrame.setSize(300, 120);         myFrame.setVisible(true);      } } In the indicated line above, write the statement to set the JFrame 's look and feel using the setDefaultLookAndFeelDecorated() method.

(Essay)
4.8/5
(36)

The Swing classes are part of a more general set of UI programming capabilities that are collectively called the ____.

(Multiple Choice)
4.8/5
(37)

Provide an example of an event-driven program.

(Essay)
4.7/5
(42)

A ____ is a Component used to trigger an action or make a selection when the user clicks it.

(Multiple Choice)
4.8/5
(41)

Which method do you use to assign a font object to a JLabel ?

(Multiple Choice)
4.9/5
(42)

Within an event-driven program, a component on which an event is generated is the ____ of the event.

(Multiple Choice)
4.8/5
(42)
Showing 21 - 40 of 79
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)