Exam 14: Introduction to Swing Components

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

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

(Essay)
4.8/5
(34)

What is the immediate parent class of JTextField ?

(Multiple Choice)
4.8/5
(40)
Match each term with the correct statement below.
Premises:
A class that controls component positioning
Responses:
frame
heavyweight components
register
Correct Answer:
Verified
Premises:
Responses:
A class that controls component positioning
frame
(Matching)
4.8/5
(42)

Write the statement to create a JLabel named welcome that holds the words "Welcome Home".

(Short Answer)
4.9/5
(30)

How can you customize the appearance of a JFrame ?

(Essay)
4.8/5
(49)

The ActionListener interface contains the ____ method specification.

(Multiple Choice)
4.8/5
(42)

Create the statements to construct two JFrame s. One JFrame should be declared as welcomeFrame and have the title "Welcome", and the second JFrame should be declared as noTitleFrame and have no title.

(Essay)
4.9/5
(38)

Which statements create a JLabel that holds the words "Happy birthday"  and adds the greeting to a JFrame object named aGreeting ?

(Multiple Choice)
4.9/5
(39)

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

(Short Answer)
4.9/5
(39)

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

(True/False)
4.8/5
(37)

The ____ responds to keyboard events.

(Multiple Choice)
4.7/5
(30)

What class is the immediate parent of JFrame ?

(Multiple Choice)
4.9/5
(40)

The ____ responds to keyboard focus events.

(Multiple Choice)
4.9/5
(30)
Match each term with the correct statement below.
Premises:
Places components in rows
Responses:
frame
lightweight components
point size
Correct Answer:
Verified
Premises:
Responses:
Places components in rows
frame
(Matching)
4.8/5
(34)
Match each term with the correct statement below.
Premises:
Divides a container into regions
Responses:
frame
point size
flow layout manager
Correct Answer:
Verified
Premises:
Responses:
Divides a container into regions
frame
(Matching)
4.9/5
(35)

How do you modify whether or not a JTextField can be edited?

(Essay)
4.8/5
(34)

Which method do you use to change the state of a JCheckBox ?

(Multiple Choice)
4.9/5
(39)

import javax.swing.*; import java.awt.*; public class JFrame4 {    public static void main(String[] args)    {       final int FRAME_WIDTH = 250;       final int FRAME_HEIGHT = 100;       -----Code here-----       JFrame aFrame = new JFrame("Fourth frame");       aFrame.setSize(FRAME_WIDTH, FRAME_HEIGHT);             aFrame.setVisible(true);       aFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);       JLabel greeting = new JLabel("Good day");       -----Code here-----       aFrame.add(greeting);    } } In the first indicated line, write the statement to create a Font object named myLook with a typeface of Times New Roman, italic, and 30-point size. In the second indicated line, create the statement to apply myLook to the greeting JLabel .

(Essay)
4.9/5
(36)

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)
5.0/5
(32)
Showing 61 - 79 of 79
close modal

Filters

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