Exam 14: Introduction to Swing Components
Exam 1: Creating Your First Java Classes76 Questions
Exam 2: Using Data81 Questions
Exam 3: Using Methods, Classes and Objects79 Questions
Exam 4: More Object Concepts84 Questions
Exam 5: Making Decisions80 Questions
Exam 6: Looping77 Questions
Exam 7: Characters, Strings and the Stringbuilder82 Questions
Exam 8: Arrays77 Questions
Exam 9: Advanced Array Concepts80 Questions
Exam 10: Introduction to Inheritance78 Questions
Exam 11: Advanced Inheritance Concepts78 Questions
Exam 12: Exception Handling79 Questions
Exam 13: File Input and Output78 Questions
Exam 14: Introduction to Swing Components79 Questions
Exam 15: Using Javafx and Scene Builder65 Questions
Select questions type
How are computer programs more user friendly when they contain GUI components? How does Java address GUI components?
(Essay)
4.8/5
(34)
Match each term with the correct statement below.
Premises:
A class that controls component positioning
Responses:
frame
heavyweight components
register
Correct Answer:
Premises:
Responses:
(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)
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)
Match each term with the correct statement below.
Premises:
Places components in rows
Responses:
frame
lightweight components
point size
Correct Answer:
Premises:
Responses:
(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:
Premises:
Responses:
(Matching)
4.9/5
(35)
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
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)