Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(TCOs 1, 4, and 6) A JList can be populated from an array. an ArrayList. a DefaultListModel. All of the above (TCOs 1, 4, and

(TCOs 1, 4, and 6) A JList can be populated from

an array.
an ArrayList.
a DefaultListModel.
All of the above

(TCOs 1, 4, and 6) Which statement adds the JList component myList to the JFrame using a scroll pane?

add myList.setScrollable(true);
add(JScrollPane(myList);
add(new JScrollPane(myList));
add JScrollPane.myList;

(TCOs 1, 4, and 6) Class _____ represents a dynamically resizable array-like data structure.

Array
Arrays
ArrayList
ListArray

(TCOs 1, 4, and 6) Which method will remove all elements in an ArrayList employees?

employees.delete()
employees.clear()
employees.empty()
employees.remove()

(TCOs 1, 4, and 6) When an item in a JList is selected by the user, a _____ occurs.

ListSelectionEvent
ItemSelectionEvent
ItemClickedEvent
ListClickedEvent

(TCOs 1, 4, and 6) Which component allows users to access a layer of GUI components via a tab?

JTabs
JTabPane
JTabbedPane
JTabPanel

(TCOs 1, 4, and 6) A tool tip can be specified for a tab using the _____ method.

Tooltip
addTab
setTooltip
tabTip

(TCOs 1, 4, and 6) Suppose ArrayList cities contain the two strings {Chicago, Miami}. Which of the following methods will cause the list to become {Chicago, Houston,Miami}?

cities.add(Houston)
cities.add(0, Houston)
cities.add(1, Houston)
cities.add(2, Houston)

(TCOs 1, 4, and 6) Which of the following is false regarding overriding of the toString method?

toString method must have no parameters.
toString method must have parameters.
The string representation of the object is determined by the programmer.
toString method must return a String.

(TCOs 1, 4, and 6) If your GUI has multiple tabs and you want to know the index of the tab currently selected, use the method

getSelectedComponent.
getIndex.
getSelectedIndex.
getSelected.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions