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
To associate an event listener with a JButton component, you must use the ___ method of the JButton class.
(Multiple Choice)
4.8/5
(43)
Which of the following statements about an inner class is true?
(Multiple Choice)
4.7/5
(44)
What happens if a text field's width is set to 10 characters and the user types more characters into it?
(Multiple Choice)
4.7/5
(31)
You have a class that extends the JComponent class. In this class you have created a painted graphical object. Your code will change the data in the graphical object. What additional code is needed to ensure that the graphical object will be updated with the changed data?
(Multiple Choice)
4.8/5
(36)
Which of the following statements will compile without error?
(Multiple Choice)
5.0/5
(32)
Which java package must be imported if a program wishes to respond to button events?
(Multiple Choice)
4.8/5
(34)
____ are generated when the user presses a key, clicks a button, or selects a menu item.
(Multiple Choice)
4.8/5
(44)
Which of the following statements about event listeners is true?
(Multiple Choice)
4.8/5
(37)
User-interface components are arranged by placing them inside ____________________.
(Multiple Choice)
4.8/5
(34)
Consider the following code snippet:
Public static void main(String[] args)
{
Final Order myOrder = new Order();
JButton button = new JButton("Calculate");
Final JLabel label = new JLabel("Total amount due");
) . .
Class MyListener implements ActionListener
{
Public void actionPerformed(ActionEvent event)
{
) . .
}
}
}
Which of the local variables can be accessed within the actionPerformed method?
(Multiple Choice)
4.8/5
(39)
Which statement should be added to this code fragment to ensure that the frame is shown?
JFrame frame = new JFrame();
(Multiple Choice)
4.9/5
(37)
What is the nickname for the graphical user interface library in Java?
(Multiple Choice)
4.7/5
(31)
To draw an ellipse, you must include which of the following import statements?
(Multiple Choice)
4.9/5
(39)
Complete the following statement to construct a circle.
Graphics g;
g.____________________(x, y, width, height);
(Multiple Choice)
4.9/5
(40)
When added to the code below, which statement will set the color of the next item drawn to green?
Public class ItalianFlagComponent extends JComponent
{
Public void paintComponent(Graphics g) {
g.drawRect(100, 100, 30, 60);
) . .
____________________________
) . .
}
}
(Multiple Choice)
4.7/5
(39)
When drawing complex shapes, provide a(n) ____ to set the position of the shape.
(Multiple Choice)
4.9/5
(37)
Use the ____ method to specify the height and width of a graphical component when you add it to a panel.
(Multiple Choice)
4.7/5
(21)
To build a user interface that contains multiple graphical components, the components ____.
(Multiple Choice)
4.8/5
(38)
A(n) ____ has an instance method addActionListener() for specifying which object is responsible for implementing the action associated with the object.
(Multiple Choice)
4.8/5
(33)
Showing 21 - 40 of 54
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)