Exam 14: Introduction to Swing Components
Exam 1: Creating Java Programs61 Questions
Exam 2: Using Data67 Questions
Exam 3: Using Methods Classes and Objects66 Questions
Exam 4: More Object Concepts66 Questions
Exam 5: Making Decisions66 Questions
Exam 6: Looping66 Questions
Exam 7: Characters Strings and the Stringbuilder68 Questions
Exam 8: Arrays66 Questions
Exam 9: Advanced Array Concepts66 Questions
Exam 10: Introduction to Inheritance66 Questions
Exam 11: Advanced Inheritance Concepts66 Questions
Exam 12: Exception Handling66 Questions
Exam 13: File Input and Output66 Questions
Exam 14: Introduction to Swing Components66 Questions
Exam 15: Advanced Gui Topics66 Questions
Exam 16: Graphics66 Questions
Select questions type
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.8/5
(41)
Match each term with the correct statement below.
Correct Answer:
Premises:
Responses:
(Matching)
4.9/5
(32)
import javax.swing.*;
import java.awt.*;
public class JFrame6
{
public static void main(String[] args)
{
final int FRAME_WIDTH = 250;
final int FRAME_HEIGHT = 100;
JFrame aFrame = new JFrame("Sixth frame");
aFrame.setSize(FRAME_WIDTH, FRAME_HEIGHT);
aFrame.setVisible(true);
aFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel greeting = new JLabel("Hello");
JLabel greeting2 = new JLabel("Who are you?");
-----Code here-----
aFrame.add(greeting);
aFrame.add(greeting2);
}
}
Using the above code, write the FlowLayout statement in the indicated line that will display the two greeting JLabel s side by side.
(Short Answer)
4.9/5
(38)
When a JFrame is closed, you can end a program that you have forgotten to exit by typing Alt+E.
(True/False)
4.8/5
(29)
What are the tasks you must perform when you declare a class that handles an event?
(Essay)
4.9/5
(32)
Swing components are UI elements such as dialog boxes and buttons. You can usually recognize their names because they begin with the letter ____________________.
(Short Answer)
5.0/5
(33)
A component can be made available or unavailable by passing true or false to the ____ method.
(Multiple Choice)
4.8/5
(40)
The JButton , JCheckBox , JComboBox , and JRadioButton components are associated with the ____ method.
(Multiple Choice)
4.8/5
(39)
In a(n) ____________________ program, the user might initiate any number of events in any order.
(Short Answer)
4.7/5
(33)
If a user enters more characters than specified in a JTextField , the extra characters are deleted.
(True/False)
5.0/5
(36)
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.8/5
(36)
The ____________________ layout manager places components in a row, and when a row is filled, it automatically spills components into the next row.
(Short Answer)
4.8/5
(40)
Write the statement to create a JCheckBox object named feeWaived that is selected. Include the label "Fee Waived".
(Short Answer)
4.8/5
(31)
Showing 41 - 60 of 66
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)