Exam 20: Graphical User Interfaces
Exam 1: Introduction76 Questions
Exam 2: Using Objects82 Questions
Exam 3: Implementing Classes108 Questions
Exam 4: Fundamental Data Types124 Questions
Exam 5: Decisions119 Questions
Exam 6: Loops107 Questions
Exam 7: Arrays and Array Lists117 Questions
Exam 8: Designing Classes88 Questions
Exam 9: Inheritance99 Questions
Exam 10: Interfaces100 Questions
Exam 11: Input/Output and Exception Handling108 Questions
Exam 12: Object-Oriented Design104 Questions
Exam 13: Recursion99 Questions
Exam 14: Sorting and Searching100 Questions
Exam 15: The Java Collections Framework102 Questions
Exam 16: Basic Data Structures102 Questions
Exam 17: Tree Structures102 Questions
Exam 18: Generic Classes75 Questions
Exam 19: Stream Processing85 Questions
Exam 20: Graphical User Interfaces75 Questions
Exam 21: Advanced Input/Output90 Questions
Exam 22: Multithreading81 Questions
Exam 23: Internet Networking74 Questions
Exam 24: Relational Databases75 Questions
Exam 25: XML74 Questions
Select questions type
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.
Free
(Multiple Choice)
4.7/5
(34)
Correct Answer:
B
What type of event does the JSlider class generate?
Free
(Multiple Choice)
4.8/5
(36)
Correct Answer:
A
If one ChangeListener is listening for three different JSlider objects, how can we determine which of the three sliders caused the event when the code enters the stateChanged method?
Free
(Multiple Choice)
4.8/5
(37)
Correct Answer:
B
The ChangeEvent class defines no methods.What makes it possible to call the getSource method on a ChangeEvent object?
(Multiple Choice)
4.9/5
(40)
Based on the statement below, which of the following adds a title to the border?
JPanel panel = new JPanel();
(Multiple Choice)
4.9/5
(30)
A complex GUI can be created with a set of nested panels.What should determine the components that go into a single panel?
(Multiple Choice)
4.7/5
(32)
In Java, each container has its own ____________________, which determines how the components are laid out.
(Multiple Choice)
4.8/5
(40)
When adding a component to a container with the ____ layout, specify the NORTH, EAST, SOUTH, WEST, or CENTER position.
(Multiple Choice)
4.8/5
(32)
Which of the following would be an appropriate use of radio buttons when ordering a pizza?
(Multiple Choice)
4.8/5
(26)
Insert the missing code in the following segment.The code intends to get the newly selected item from the combo box.
JComboBox facenameCombo = new JComboBox();
String selectedString = __________________________;
(Multiple Choice)
4.8/5
(28)
Which of the following methods returns the object that was selected in the JComboBox?
(Multiple Choice)
4.9/5
(37)
If the makeMenuItem method is called four times, at most how many different actions can be performed by these four newly created MenuItem objects when the doSomethingElse method is called?
public JMenuItem makeMenuItem(String menuLabel)
{
JMenuItem mi = new JMenuItem(menuLabel);
class MyMenuListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
doSomethingElse(e);
}
}
mi.addActionListener(new MyMenuListener());
return mi;
}
(Multiple Choice)
4.7/5
(34)
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
(32)
If a JPanel with a BorderLayout manager contains a single component that was added to the CENTER, which parts of the JPanel does the component fill?
i.North
II.South
III.Center
IV.West
v.East
(Multiple Choice)
4.9/5
(37)
Which layout manager allows you to add components to it by invoking the container's add method with the component as the only argument to add.
i.FlowLayout
II.BorderLayout
III.GridLayout
(Multiple Choice)
4.9/5
(34)
When method makeMenuItem is called, how many objects are being created?
public JMenuItem makeMenuItem(final String menuLabel)
{
JMenuItem mi = new JMenuItem(menuLabel);
class MyMenuListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
doSomethingElse();
System.out.println(menuLabel);
}
}
mi.addActionListener(new MyMenuListener());
return mi;
}
(Multiple Choice)
4.8/5
(43)
What is the default layout manager of the content pane of a JFrame?
(Multiple Choice)
4.8/5
(44)
Which of the following GUI objects generate(s) action events?
i.JComboBox
II.JRadioButton
III.JButton
(Multiple Choice)
4.8/5
(31)
Showing 1 - 20 of 75
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)