Exam 11: Advanced 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
What is the default layout manager of JPanel?
Free
(Multiple Choice)
4.8/5
(39)
Correct Answer:
A
The code below will not compile successfully unless the argument to the makeMenuItem method is final. Why not?
Public JMenuItem makeMenuItem(final String menuLabel)
{
JMenuItem mi = new JMenuItem(menuLabel);
Class MyMenuListener implements ActionListener
{
Public void actionPerformed(ActionEvent
Free
(Multiple Choice)
4.8/5
(35)
Correct Answer:
C
Which layout manager may change the location and size of existing components when new ones are added?
I FlowLayout
II BorderLayout
III GridLayout
Free
(Multiple Choice)
4.8/5
(37)
Correct Answer:
B
Which layout manager constructor call would be best-suited to create a telephone handset GUI which has three rows of three keys each with labels, 1,2,3,4,5,6,7,8,9, and a fourth row with labels *, 0, and #?
(Multiple Choice)
4.9/5
(35)
Which component can generate action events?
I JMenuBar
II JMenu
III JMenuItem
(Multiple Choice)
4.8/5
(35)
Consider the following code snippet:
Public class MyMouseListener implements MouseListener
{
Public void mousePressed(MouseEvent event)
{
Double x;
Double y;
_______
System.out.println("x: " + x + ", y: " + y);
}
) . .
}
Which of the following statements should be filled in the blank to print out where the mouse was pressed?
(Multiple Choice)
4.9/5
(32)
Suppose listener is an instance of a class that implements the MouseListener interface. How many methods does listener have?
(Multiple Choice)
4.9/5
(31)
Consider the following code snippet:
Class MyListener implements ActionListener
{
Public void actionPerformed(ActionEvent event)
{
System.out.println(event);
}
}
timer t = new Timer(interval, listener);
t.start();
What is wrong with this code?
(Multiple Choice)
4.8/5
(34)
To create a _____ layout, you supply the number of rows and columns in the constructor, then add the components, row by row, left to right.
(Multiple Choice)
4.8/5
(33)
Consider the code snippet below:
Public class RectangleComponent extends JComponent
{
Private static final int RECTANGLE_WIDTH = 20;
Private static final int RECTANGLE_HEIGHT = 30;
Private int xLeft;
Private int yTop;
Public RectangleComponent()
{
xLeft = 0;
yTop = 0;
}
Public void paintComponent(Graphics g) {
g.fillRect(xLeft, yTop, RECTANGLE_WIDTH, RECTANGLE_HEIGHT);
}
Public void moveRectangleBy(int dx, int dy)
{
xLeft = xLeft + dx;
yTop = yTop + dy;
repaint();
}
}
Which statement(s) causes the rectangle to appear at an updated location?
(Multiple Choice)
4.9/5
(44)
For a new programmer using the Swing JSlider component for the first time, which of these is the least important thing to know?
(Multiple Choice)
4.8/5
(33)
Which layout manager places objects left-to-right, row by row into a fixed set of rows and columns?
(Multiple Choice)
4.9/5
(40)
What is the best way to discover the set of Swing components?
(Multiple Choice)
4.8/5
(38)
What is known for certain from this correct code excerpt?
ActionListener openListener = new FileOpenListener();
JMenuItem fileOpen = new JMenuItem("Open File");
FileOpen.addActionListener(openListener);
(Multiple Choice)
4.8/5
(39)
What is the most time-effective way to build a GUI quickly and concentrate on coding the logic of the program?
(Multiple Choice)
4.7/5
(31)
Given four JRadioButton objects in a ButtonGroup, how many radio buttons can be selected at the same time?
(Multiple Choice)
4.9/5
(40)
Showing 1 - 20 of 91
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)