Exam 14: Introduction to Swing Components

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

You define the text to be displayed in a tool tip by using the setToolTipText() method and passing an appropriate ____ to it.

Free
(Multiple Choice)
4.8/5
(34)
Correct Answer:
Verified

C

Look and feel comprises the elements of design, style, and ________________ in any user interface.

Free
(Short Answer)
4.7/5
(35)
Correct Answer:
Verified

functionality

The ____ responds to keyboard focus events.

Free
(Multiple Choice)
4.9/5
(28)
Correct Answer:
Verified

D

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

(Multiple Choice)
4.8/5
(35)

Write the statement to provide a JTextField object named myInfo that allows enough room for a user to enter 15 characters.

(Short Answer)
4.8/5
(40)

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.8/5
(38)

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

(Multiple Choice)
4.8/5
(37)

The default behavior of a JFrame is to use the border layout format, which divides a container into regions.

(True/False)
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
(35)

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

(Multiple Choice)
4.8/5
(35)

What is the default layout manager for JFrame ?

(Multiple Choice)
5.0/5
(41)

import javax.swing.*; public class JFrameLabel {     public static void main(String[] args)     {        final int FRAME_WIDTH = 300;        final int FRAME_HEIGHT = 120;        JFrame myFrame = new JFrame("Frame with label");        myFrame.setSize(FRAME_WIDTH, FRAME_HEIGHT);        myFrame.setVisible(true);        myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);        -----Code here-----        -----Code here-----      } } The above code shows an application in which a JFrame is created and its size, visibility, and close operation are set. In the indicated lines provided, write the code to create a JLabel named thanks that holds the words "Thank you for your business". Then, write the statement to add the JLabel to the JFrame .

(Essay)
4.8/5
(45)

Which of the following statements will correctly set a JFrame named myFrame to be visible?

(Multiple Choice)
4.9/5
(27)

How are computer programs more user friendly when they contain GUI components? How does Java address GUI components?

(Essay)
4.7/5
(36)

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

(Short Answer)
4.9/5
(41)

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)
4.9/5
(42)

When a user closes a JFrame by clicking the Close button in the upper-right corner, the default behavior is for the JFrame to close and the application to terminate.

(True/False)
4.7/5
(41)

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
(42)

Write the code to build a JComboBox named sideDish with no arguments. Then, create the addItem() methods to provide options for "Fries", "Salad", and "Fruit".

(Essay)
4.8/5
(41)

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

(Multiple Choice)
4.8/5
(39)
Showing 1 - 20 of 66
close modal

Filters

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