Exam 14: Introduction to Swing Components

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

How do you change the text of a JLabel ? Provide an example.

(Essay)
4.9/5
(32)

An object that is interested in an event is called a source.

(True/False)
4.8/5
(46)
Match each term with the correct statement below.
Premises:
Component that holds other components
Responses:
layout manager
look and feel
lightweight components
Correct Answer:
Verified
Premises:
Responses:
Component that holds other components
layout manager
(Matching)
4.9/5
(30)

A method that executes because it is called automatically when an appropriate event occurs is an event ____.

(Multiple Choice)
4.9/5
(41)

Write the statement to create a JButton named submitButton with the label "Submit your data".

(Short Answer)
4.8/5
(37)

The ____ layout manager places components in a row, and when a row is filled, it automatically spills components into the next row.

(Multiple Choice)
4.7/5
(33)

You can call a JFrame 's setDefaultCloseOperation() method and use ____ as an argument to keep the JFrame visible and continue running the program.

(Multiple Choice)
4.9/5
(45)

When setting a JFrame 's size, part of the area is unusable because it is consumed by the JFrame 's title bar and borders.

(True/False)
5.0/5
(29)
Match each term with the correct statement below.
Premises:
Arial, Century, Monospaced, and Times New Roman
Responses:
look and feel
event handler
editable
Correct Answer:
Verified
Premises:
Responses:
Arial, Century, Monospaced, and Times New Roman
look and feel
(Matching)
4.8/5
(41)

The JButton , JCheckBox , JComboBox , and JRadioButton components are associated with the ____ method.

(Multiple Choice)
4.9/5
(38)

import javax.swing.*; public class JFrame1 {      public static void main(String[] args)      {          JFrame aFrame = new JFrame("First frame");          aFrame.setSize(300, 125);          aFrame.setVisible(true);      } } Explain the purpose of each statement in the main() method above and why they are necessary for creating a JFrame .

(Essay)
4.8/5
(38)

What are the tasks you must perform when you declare a class that handles an event?

(Essay)
4.9/5
(32)

What are the four JFrame constructors?

(Essay)
4.8/5
(28)
Match each term with the correct statement below.
Premises:
The design, style, and functionality of a user interface
Responses:
point size
window decorations
fonts
Correct Answer:
Verified
Premises:
Responses:
The design, style, and functionality of a user interface
point size
(Matching)
4.8/5
(33)
Match each term with the correct statement below.
Premises:
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
Responses:
layout manager
window decorations
flow layout manager
Correct Answer:
Verified
Premises:
Responses:
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
layout manager
(Matching)
4.8/5
(34)

Within an implementation of the itemStateChanged() method, you can use the ____ method to determine which object generated the event, and the getStateChange() method to determine whether the event was a selection or a deselection.

(Multiple Choice)
4.9/5
(37)
Match each term with the correct statement below.
Premises:
Are written completely in Java and do not have to rely on the local operating system code
Responses:
frame
layout manager
register
Correct Answer:
Verified
Premises:
Responses:
Are written completely in Java and do not have to rely on the local operating system code
frame
(Matching)
4.8/5
(24)

The ____ method of JComboBox returns the maximum number of items the combo box can display without a scroll bar.

(Multiple Choice)
4.8/5
(39)

You can use the setEnabled() method to make a component available or unavailable by passing true or false to it.

(True/False)
4.8/5
(34)
Match each term with the correct statement below.
Premises:
Sign up an object as a listener
Responses:
fonts
window decorations
container
Correct Answer:
Verified
Premises:
Responses:
Sign up an object as a listener
fonts
(Matching)
4.8/5
(39)
Showing 41 - 60 of 79
close modal

Filters

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