Exam 12: GUI Applications–Part 2
Exam 1: Introduction to Computers and Java40 Questions
Exam 2: Java Fundamentals40 Questions
Exam 3: A First Look at Classes and Objects40 Questions
Exam 4: Decision Structures40 Questions
Exam 5: Loops and Files40 Questions
Exam 6: A Second Look at Classes and Objects40 Questions
Exam 7: Arrays and the ArrayList Class40 Questions
Exam 8: Text Processing and Wrapper Classes40 Questions
Exam 9: Inheritance40 Questions
Exam 10: Exceptions and Advanced File I/O40 Questions
Exam 11: GUI Applications–Part 140 Questions
Exam 12: GUI Applications–Part 240 Questions
Exam 13: Applets and More40 Questions
Exam 14: Creating GUI Applications with JavaFX40 Questions
Exam 15: Recursion20 Questions
Exam 16: Databases40 Questions
Select questions type
If null is passed as an argument to the JFileChooser class's showOpenDialog method,
Free
(Multiple Choice)
4.8/5
(42)
Correct Answer:
D
What will be the result of the following code if the user simply clicks OK?
JPanel panel = new JPanel();
Color selectedColor;
SelectedColor =
JColorChooser.showDialog(null, "Select a Color", Color.BLUE);
Panel.setForeground(selectedColor);
Free
(Multiple Choice)
4.8/5
(38)
Correct Answer:
B
Which of the following is not a class used in constructing a menu system?
Free
(Multiple Choice)
4.9/5
(34)
Correct Answer:
C
What will be the result when the following code is executed if addressList exists and has values stored in it, and addrList is an array with values stored in it?
AddressList.setListData(addrList);
(Multiple Choice)
4.9/5
(34)
If you call the JTextField component's setEditable method and pass false as the argument, then the text field becomes
(Multiple Choice)
4.8/5
(43)
What is returned by the JList class's getSelectedIndex method?
(Multiple Choice)
4.9/5
(43)
What will be the result when the following code is executed?
ImagePanel = new JPanel();
ImageLabel = new JLabel();
ImagePanel.Add(imageLabel);
ImageIcon sunnyFaceImage = new ImageIcon("SunnyFace.gif"); imageLabel.setIcon(sunnyFaceImage);
Pack();
(Multiple Choice)
4.8/5
(37)
What will be displayed when the following code is executed?
JLabel myLabel = new JLabel ("It's a beautiful morning!"); myLabel.setIcon(SunnyFace.gif);
(Multiple Choice)
4.8/5
(33)
The appearance of a particular system's GUI is known as its
(Multiple Choice)
4.8/5
(42)
Which of the following statements creates a horizontal slider component with a minimum value of 0, a maximum value of 50, and an initial value of 25?
(Multiple Choice)
4.8/5
(36)
If myList is a JList component, what will the value of item be after the following statement is executed?
Item = myList.getSelectedIndex();
(Multiple Choice)
4.9/5
(38)
Just like regular radio button components, you must group radio button menu items in a button group in order to create a mutually exclusive relationship between them.
(True/False)
4.9/5
(38)
If nameList is an instance of a JList component, which of the following statements would display 4 rows in nameList.
(Multiple Choice)
4.7/5
(35)
You assign a tool tip to a component with the ________ method, which is inherited from the JComponent class.
(Multiple Choice)
4.9/5
(42)
If multiple items have been selected in a list component, you should use the getSelectedValues or getSelectedIndices methods to retrieve the selected items.
(True/False)
4.8/5
(31)
The ListSelectionListener interface is in the ________ package.
(Multiple Choice)
4.7/5
(34)
To change an application's look and feel, you call this static method of the UIManager class.
(Multiple Choice)
4.8/5
(28)
Showing 1 - 20 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)