Exam 10: Graphical User Interfaces
Exam 1: Introduction96 Questions
Exam 2: Fundamental Data Types103 Questions
Exam 3: Decisionseasy99 Questions
Exam 4: Loops100 Questions
Exam 5: Methods94 Questions
Exam 6: Arrays and Arraylists100 Questions
Exam 7: Inputoutput and Exception Handling100 Questions
Exam 8: Objects and Classes101 Questions
Exam 9: Inheritance and Interfaces99 Questions
Exam 10: Graphical User Interfaces54 Questions
Exam 11: Advanced User Interfaces91 Questions
Exam 12: Object-Oriented Design100 Questions
Exam 13: Recursion100 Questions
Exam 14: Sorting and Searching99 Questions
Exam 15: The Java Collections Framework100 Questions
Exam 16: Basic Data Structures94 Questions
Exam 17: Tree Structures100 Questions
Exam 18: Generic Classes78 Questions
Exam 19: Streams and Binary Inputoutput82 Questions
Exam 20: Multithreading82 Questions
Exam 21: Internet Networking74 Questions
Exam 22: Relational Databases75 Questions
Exam 23: XML74 Questions
Exam 24: Web Applications74 Questions
Select questions type
Consider the following code snippet:
JPanel panel = new JPanel();
JFrame frame = new JFrame();
JButton button = new JButton("Click me");
JLabel label = new JLabel("Show the answer");
Frame.add(label);
Frame.add(button);
Panel.add(frame);
Which of the following statements is true?
(Multiple Choice)
4.8/5
(34)
Complete this code fragment to ensure that the application exits properly when the user closes the frame:
JFrame frame = new JFrame();
(Multiple Choice)
4.7/5
(34)
Which of the following statements about events and graphical user interface programs is true?
(Multiple Choice)
4.9/5
(41)
Consider the following code snippet:
Public static void main(String[] args)
{
Order myOrder = new Order();
JButton button = new JButton("Calculate");
JLabel label = new JLabel("Total amount due");
) . .
Class MyListener implements ActionListener
{
Public void actionPerformed(ActionEvent event)
{
Label.setText("Total amount due " + myOrder.getAmountDue());
}
}
}
What is wrong with this code?
(Multiple Choice)
5.0/5
(40)
Consider the following code snippet:
JPanel panel = new JPanel();
JFrame frame = new JFrame();
JLabel label = new JLabel("Show the answer");
JTextField field = new JTextField(5);
Frame.add(label);
Frame.add(field);
Panel.add(frame);
Which of the following statements is true?
(Multiple Choice)
4.8/5
(34)
Place drawing instructions inside the __________ method, which is called whenever the component needs to be repainted.
(Multiple Choice)
4.8/5
(34)
Which of the following statements should be added to this code fragment to set the frame size to a width of 400 and a height of 200?
Final int FRAME_WIDTH = 400;
Final int FRAME_HEIGHT = 200;
JFrame frame = new JFrame();
(Multiple Choice)
4.8/5
(42)
Event listeners are often installed as ____ classes so that they can have access to the surrounding fields, methods, and final variables.
(Multiple Choice)
4.9/5
(33)
Which container is used to group multiple user-interface components together?
(Multiple Choice)
4.8/5
(37)
What's the difference between a text field and a text area?
(Multiple Choice)
4.7/5
(39)
Which java package must be imported if a program wishes to respond to button events?
(Multiple Choice)
4.9/5
(36)
The Graphics class is part of the ____________________ package.
(Multiple Choice)
4.8/5
(33)
Consider the following code snippet:
JFrame frame = new JFrame();
JPanel panel = new JPanel();
Which statement would add the panel to the frame?
(Multiple Choice)
4.8/5
(40)
Showing 41 - 54 of 54
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)