Deck 24: Swing Gui Components

ملء الشاشة (f)
exit full mode
سؤال
JLabel can be attached to a JFrame using method ________.

A) attach
B) contain
C) append
D) add
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Which of the following statements about a JLabel is false?

A) Applications rarely change a label's contents after creating it.
B) A JLabel can display text and an image.
C) A JLabel can display text and a button.
D) A JLabel is a subclass of JComponent.
سؤال
The text "Hello there, my friend." is an example of what type of capitalization?

A) sentence-style capitalization.
B) book-title capitalization.
C) Neither of the above.
D) Both of the above.
سؤال
Which method sets the text that's displayed when the user hovers over a JLabel?

A) setHover
B) setHoverText
C) setToolTip
D) setToolTipText
سؤال
Which of the following is not a GUI component (control or widget)?

A) String.
B) Button.
C) Menu.
D) Combo box.
سؤال
Which of the following does not generate GUI events?

A) Typing in a text field.
B) Selecting an item from a menu.
C) Viewing the text in a label.
D) Moving the mouse.
سؤال
Which pair of words does not complete the sentence below correctly? A ________ is a(n) ________.

A) Container, Component.
B) Container, JPanel.
C) JComponent, Container.
D) Component, Object.
سؤال
Which methods retrieve and set the image that's displayed in a JLabel?

A) getIcon, setIcon.
B) getResource, setResource.
C) getText, setText.
D) getImageIcon, setImageIcon.
سؤال
Which of the following statements about Swing GUI components is false?

A) Swing components are less portable but more flexible than the original Java GUI components from package java.awt.
B) Most Swing components are written completely in Java.
C) Swing components allow the user to specify a uniform look-and-feel across all platforms.
D) Swing components allow the user to change the look-and-feel while the program is running.
سؤال
Which of the following expressions creates a JLabel that displays the text "Here is what I look like!" The JLabel should display Icon object face, and the JLabel's contents should be left aligned.

A) new JLabel("Here is what I look like!", face, SwingConstants.LEFT)
B) new JLabel("Here is what I look like!", face, SwingJustification.LEFT)
C) new JLabel("Here is what I look like!", SwingConstants.LEFT, face)
D) new JLabel("Here is what I look like!", SwingJustification.LEFT, face)
سؤال
Which JFrame constant indicates that the program should terminate when the window is closed by the user?

A) TERMINATE_ON_CLOSE.
B) IMMEDIATELY_CLOSE.
C) EXIT_ON_CLOSE.
D) All of the above.
سؤال
The JOptionPane constant used to display an icon prompting the user for input is:

A) JOptionPane.ERROR_MESSAGE.
B) JOptionPane.INFORMATION_MESSAGE.
C) JOptionPane.QUESTION_MESSAGE.
D) JOptionPane.WARNING_MESSAGE.
سؤال
Some common lightweight component features supported by JComponent include:

A) support for user-interface localization.
B) shortcut keys.
C) tool tips.
D) All of the above.
سؤال
__________Provides the basic attributes and behaviors of a window-a title bar at the top of the window, and buttons to minimize, maximize and close the window.

A) JLabel.
B) JFrame.
C) JSwing.
D) JWindowControl.
سؤال
Which component contains menus?

A) Menu button.
B) Title bar.
C) Menu bar.
D) Combo box.
سؤال
Which of the following statements for a JTextField is false?

A) Can be used to display uneditable text.
B) Can be used to display editable text.
C) Enables users to enter data from the keyboard.
D) Displays a list of fields.
سؤال
Which of the following is the method used to display a dialog box to gather input?

A) showMessageDialog.
B) getInput.
C) inputDialog.
D) showInputDialog.
سؤال
Method _____________-can be used to set the layout manager of a container.

A) setManager
B) setLayout
C) setLayoutManager
D) setGUILayout
سؤال
Together, the appearance and the way in which the user interacts with the application are known as that application's ________.

A) abstract window toolkit.
B) look-and-feel.
C) swing factor.
D) All of the above.
سؤال
Which of the following statements about heavyweight components is false?

A) AWT components are not heavyweight components.
B) Several Swing components are heavyweight components.
C) The look-and-feel may vary across platforms.
D) The functionality may vary across platforms.
سؤال
Which of the following is false?

A) A JPasswordField shows that characters are being entered, but hides the actual character with an echo character.
B) Class JTextField extends JTextComponent; Class JPasswordField extends JTextField.
C) Both JTextFields and JPasswordFields are single-line areas in which the user can enter text via the keyboard.
D) JPasswordFields generate events; JTextFields do not.
سؤال
A JRadioButton is different from a JCheckBox in that _________.

A) a JRadioButton is a subclass of JToggleButton, JCheckBox is not.
B) normally several JRadioButtons are grouped together and are mutually exclusive.
C) a JRadioButton is a type of button, JCheckBox is not.
D) a JRadioButton is a state button, JCheckBox is not.
سؤال
Which of the following answers does not complete the sentence correctly? An anonymous inner class__________ .

A) is frequently used for GUI event handling
B) is non-static
C) does not need a handle to its outer class to access its methods and variables
D) cannot be declared private
سؤال
Which of the following choices completes the sentence correctly?
A(n)_____ is a(n)______ .

A) JToggleButton, JCheckBox
B) JToggleButton, JRadioButton
C) JButton, JToggleButton
D) JButton, AbstractButton
سؤال
Every JComponent has an instance variable called ____that enables the object to maintain references to all its registered listeners.

A) registeredListenerList
B) listenerList
C) registeredList
D) eventListenerList
سؤال
Which of the following most completely describes the steps for setting up event handling for a GUI component?

A) Create a class that represents the event handler, attach the JFrame to a JWindow object and register the event handler.
B) Implement an appropriate event-listener interface and register the event handler.
C) Create a class that represents the event handler and implement an appropriate event-listener interface.
D) Create a class that represents the event handler, implement an appropriate event-listener interface and register the event handler.
سؤال
Which of the following completes the sentence below correctly?
A(n)_____________________ is a(n)________________- .

A) InputEvent, MouseEvent.
B) ActionEvent, AdjustmentEvent.
C) FocusEvent, WindowEvent.
D) ContainerEvent, ComponentEvent.
سؤال
Which of the following is not necessary to use the event delegation model?

A) An event listener must be registered.
B) An event handler must be implemented.
C) The appropriate interface must be implemented.
D) The appropriate interface must be registered.
سؤال
The logical relationship between radio buttons is maintained by objects of what class?

A) MutualExclusionGroup
B) RadioButtonGroup
C) Group
D) ButtonGroup
سؤال
Forgetting to register an event-handler object for a particular GUI component's event type causes ___________.

A) events of that type to be ignored.
B) all of the GUI component's events to be ignored.
C) a compilation error.
D) None of the above.
سؤال
When the user clicks a JCheckBox, a(n)_______ occurs.

A) CheckedEvent
B) ButtonEvent
C) ItemEvent
D) ActionEvent
سؤال
How many event-listener interfaces correspond to each event type?

A) one.
B) two.
C) one or more.
D) zero.
سؤال
Which of the following is not a type of button?

A) command buttons.
B) toggle buttons.
C) check boxes.
D) All of the above are types of buttons.
سؤال
The method setRolloverIcon is used to ________.

A) Handle a key event
B) Change the button text
C) Change the button icon
D) All of the above
سؤال
GUI event with which the user interacts is the ________________.

A) event effector.
B) event container.
C) event raiser.
D) event source.
سؤال
Which method determines if a JCheckBox is selected?

A) isSelected
B) getSelected
C) selected
D) None of the above
سؤال
Which of the following statements makes the text in a JTextField uneditable?

A) textField.setEditable(true);
B) textField.setEditable(false);
C) textField.setUneditable(true);
D) textField.setUneditable(false);
سؤال
Which of the following is stateless?

A) JButton.
B) JToggleButton.
C) JRadioButton.
D) JCheckBox.
سؤال
When the user presses Enter in a JPasswordField, the GUI component generates an_______ , which is processed by an object that implements the interface___________ .

A) ActionEvent, ActionListener.
B) ActionEvent, ActionEventListener.
C) TextEvent, TextListener.
D) TextEvent, TextEventListener.
سؤال
JPasswordField contains method ______________to obtain the data entered.

A) getInput.
B) getPassword.
C) getText.
D) getEcho.
سؤال
Method paintComponent is called when:

A) a lightweight Swing component is created.
B) a lightweight Swing component is displayed.
C) a lightweight Swing component is clicked.
D) an application exits.
سؤال
A user of a one-button mouse can simulate pushing the middle button on a three-button mouse by holding the___________ while clicking the left mouse button.

A) Alt key.
B) Meta key.
C) Ctrl key.
D) Shift key.
سؤال
Method getSelectedValues of class JList returns:

A) an array of ints representing the indices of the selected items.
B) an array of doubles representing the indices of the selected items.
C) an array of Strings representing the selected items.
D) an array of Objects representing the selected items.
سؤال
In what cases are adapter classes useful?

A) When an adapter GUI control is clicked.
B) When every method in the event-listener interface is to use the same functionality.
C) When it is not desirable to declare every method in the event-listener interface.
D) None of the above.
سؤال
The setMaximumRowCount method is used for:

A) Button.
B) JComboBox.
C) JRadioButton.
D) JToggleButton.
سؤال
Class Point represents ________.

A) a filled oval
B) an x-y coordinate pair
C) an object used to draw
D) a period in a sentence
سؤال
Adding a ButtonGroup object to a container ________.

A) is necessary for the functionality of the ButtonGroup to work properly.
B) causes all the JRadioButtons in the group to have their event handlers registered.
C) results in a compilation error.
D) None of the above.
سؤال
Which of the following statements about anonymous inner classes is false?

A) They are declared without a name.
B) They typically appear inside a method declaration.
C) They are declared with the anonymous keyword.
D) They can access their top-level class's members.
سؤال
Which of the following is a MouseMotionListener method?

A) mousePressed.
B) mouseExited.
C) mouseDragged.
D) mouseClicked.
سؤال
Selecting a JList item generates ________.

A) an ActionEvent
B) a ListItemEvent
C) a ListSelectionEvent
D) a ListSelectionItemEvent
سؤال
Method getSelectedIndex of class JComboBox returns:

A) the index of the selected item in the JComboBox.
B) the selected item in the JComboBox, as a String.
C) the index of the previously selected item.
D) None of the above.
سؤال
Which MouseEvent method can be used to determine if the Alt key is pressed?

A) isAltPressed.
B) isAltDown.
C) getClickCount.
D) AltPressed.
سؤال
When a component is_________- , paintComponent clears the component's background before the component is displayed.

A) transparent
B) opaque
C) oblique
D) concave
سؤال
Which of the following objects cannot trap mouse events?

A) JTextField.
B) ButtonGroup.
C) JButton.
D) JComponent.
سؤال
When the arrow on a JComboBox is clicked:

A) an ItemEvent occurs.
B) a scrollbar always appears.
C) an ActionEvent occurs.
D) The JComboBox expands to a list.
سؤال
Consider the list below:
January
February
March
April
May
June
July
August
September
October
November
December
What type of JList selection mode would allow the user to select March, June and July in one step?

A) SINGLE_SELECTION.
B) SINGLE_INTERVAL_SELECTION.
C) MULTIPLE_INTERVAL_SELECTION.
D) All of the above.
سؤال
The BorderLayout layout manager:

A) divides an area into five regions: NORTH, SOUTH, EAST, WEST and CENTER.
B) divides an area into five regions: UP, DOWN, LEFT, RIGHT and MIDDLE.
C) orders components vertically.
D) order components horizontally.
سؤال
Which of the following statements about adapters is false?

A) An adapter class implements an interface.
B) An adapter class provides a default (empty) implementation of every method in the interface.
C) Programmers override selected adapter methods.
D) A ComponentListener is a ComponentAdaptor.
سؤال
A JScrollPane is provided automatically for which of the following?

A) JToggleButton.
B) JRadioButton.
C) JList.
D) None of the above.
سؤال
A MouseHandler object implements which two interfaces?

A) MouseListener and MouseActionListener.
B) MouseListener and MouseMotionListener.
C) MouseListener and MouseEventListener.
D) MouseListener only.
سؤال
Which of the following statements about JPanels is false?

A) A JPanel is a JComponent.
B) A JPanel is a Container.
C) A JPanel does not have a content pane.
D) A JPanel has a fixed size.
سؤال
BorderLayout implements interface ________.

A) ActionListener
B) FlowLayout.
C) Layout
D) LayoutManager2
سؤال
FlowLayout is ________.

A) an abstract class
B) a way of organizing components vertically
C) the simplest layout manager
D) left-aligned by default
سؤال
Using layout managers ________.

A) provides the greatest level of control over a GUI's appearance
B) can be faster than creating a GUI with absolute positioning
C) allows the programmer to specify the exact location of each GUI component with respect to the upper-left corner of the Container
D) allows the programmer to specify the exact location of each GUI component with respect to the lower-left corner of the Container
سؤال
Class JTextArea's getSelectedText method ________.

A) returns the text in the JTextArea
B) returns the selected text in the JTextArea
C) displays only the selected text in the JTextArea
D) sets the selected text in the JTextArea
سؤال
The Shift key is a(n)__________- key.

A) modifier
B) action
C) output
D) None of the above
سؤال
When components are added to a container with a GridLayout, the component ________.

A) fills the next spot in the row, continuing in the first position of the next row if the current row is full
B) fills the next spot in the column, continuing in the first position of the next column if the column is full
C) fills in row x, column y if x and y are two integers passed to the Container method add
D) fills in a random empty position in the grid
سؤال
A JTextArea ________.

A) provides a bounding box used for the layout of JTextFields
B) wraps lines by default
C) provides an area for manipulating multiple lines of text
D) provides scrollbars for JTextFields
سؤال
Which of the following is not a KeyListener method?

A) keyPressed.
B) keyReleased.
C) keyClicked.
D) keyTyped.
سؤال
Each container can have ________.

A) only one layout manager
B) one or more layout managers
C) zero or more layout managers
D) only one or two layout managers
سؤال
By default JScrollPane ________.

A) always displays scrollbars
B) never displays scrollbars
C) only displays scrollbars if they are needed
D) None of the above
سؤال
The class GridLayout constructs to hold components.

A) a horizontal grid with one row
B) a vertical grid with one column
C) a grid with multiple rows and columns
D) a square grid with the same number of rows as columns
سؤال
Which region is used by default when a Component is added to a BorderLayout?

A) NORTH
B) CENTER
C) WEST
D) LEFT
سؤال
Method _________indicates that a Component should be refreshed on screen as soon as possible with a call to that control's paintComponent method.

A) refresh
B) repaint
C) repaintComponent
D) redraw
سؤال
All layout managers implement the interface ________.

A) LayoutInterface
B) InterfaceLayoutManager
C) LayoutManagerInterface
D) LayoutManager
سؤال
Which layout manager is the default for JFrame?

A) FlowLayout
B) BorderLayout
C) GridLayout
D) None of the above
سؤال
Which methods can be used to change the scrollbar policies?

A) setHoizontalPolicy, setVerticalPolicy.
B) setHorizontal, setVertical.
C) setHPolicy, setVPolicy.
D) setHorizontalScrollBarPolicy, setVerticalScrollBarPolicy.
سؤال
FlowLayout method_________ changes the alignment for the FlowLayout.

A) setLayout
B) modifyAlignment
C) setAlignment
D) setAlign
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/78
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 24: Swing Gui Components
1
JLabel can be attached to a JFrame using method ________.

A) attach
B) contain
C) append
D) add
D
2
Which of the following statements about a JLabel is false?

A) Applications rarely change a label's contents after creating it.
B) A JLabel can display text and an image.
C) A JLabel can display text and a button.
D) A JLabel is a subclass of JComponent.
C
3
The text "Hello there, my friend." is an example of what type of capitalization?

A) sentence-style capitalization.
B) book-title capitalization.
C) Neither of the above.
D) Both of the above.
sentence-style capitalization.
4
Which method sets the text that's displayed when the user hovers over a JLabel?

A) setHover
B) setHoverText
C) setToolTip
D) setToolTipText
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
5
Which of the following is not a GUI component (control or widget)?

A) String.
B) Button.
C) Menu.
D) Combo box.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
6
Which of the following does not generate GUI events?

A) Typing in a text field.
B) Selecting an item from a menu.
C) Viewing the text in a label.
D) Moving the mouse.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
7
Which pair of words does not complete the sentence below correctly? A ________ is a(n) ________.

A) Container, Component.
B) Container, JPanel.
C) JComponent, Container.
D) Component, Object.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
8
Which methods retrieve and set the image that's displayed in a JLabel?

A) getIcon, setIcon.
B) getResource, setResource.
C) getText, setText.
D) getImageIcon, setImageIcon.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
9
Which of the following statements about Swing GUI components is false?

A) Swing components are less portable but more flexible than the original Java GUI components from package java.awt.
B) Most Swing components are written completely in Java.
C) Swing components allow the user to specify a uniform look-and-feel across all platforms.
D) Swing components allow the user to change the look-and-feel while the program is running.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
10
Which of the following expressions creates a JLabel that displays the text "Here is what I look like!" The JLabel should display Icon object face, and the JLabel's contents should be left aligned.

A) new JLabel("Here is what I look like!", face, SwingConstants.LEFT)
B) new JLabel("Here is what I look like!", face, SwingJustification.LEFT)
C) new JLabel("Here is what I look like!", SwingConstants.LEFT, face)
D) new JLabel("Here is what I look like!", SwingJustification.LEFT, face)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
11
Which JFrame constant indicates that the program should terminate when the window is closed by the user?

A) TERMINATE_ON_CLOSE.
B) IMMEDIATELY_CLOSE.
C) EXIT_ON_CLOSE.
D) All of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
12
The JOptionPane constant used to display an icon prompting the user for input is:

A) JOptionPane.ERROR_MESSAGE.
B) JOptionPane.INFORMATION_MESSAGE.
C) JOptionPane.QUESTION_MESSAGE.
D) JOptionPane.WARNING_MESSAGE.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
13
Some common lightweight component features supported by JComponent include:

A) support for user-interface localization.
B) shortcut keys.
C) tool tips.
D) All of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
14
__________Provides the basic attributes and behaviors of a window-a title bar at the top of the window, and buttons to minimize, maximize and close the window.

A) JLabel.
B) JFrame.
C) JSwing.
D) JWindowControl.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
15
Which component contains menus?

A) Menu button.
B) Title bar.
C) Menu bar.
D) Combo box.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
16
Which of the following statements for a JTextField is false?

A) Can be used to display uneditable text.
B) Can be used to display editable text.
C) Enables users to enter data from the keyboard.
D) Displays a list of fields.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
17
Which of the following is the method used to display a dialog box to gather input?

A) showMessageDialog.
B) getInput.
C) inputDialog.
D) showInputDialog.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
18
Method _____________-can be used to set the layout manager of a container.

A) setManager
B) setLayout
C) setLayoutManager
D) setGUILayout
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
19
Together, the appearance and the way in which the user interacts with the application are known as that application's ________.

A) abstract window toolkit.
B) look-and-feel.
C) swing factor.
D) All of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
20
Which of the following statements about heavyweight components is false?

A) AWT components are not heavyweight components.
B) Several Swing components are heavyweight components.
C) The look-and-feel may vary across platforms.
D) The functionality may vary across platforms.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
21
Which of the following is false?

A) A JPasswordField shows that characters are being entered, but hides the actual character with an echo character.
B) Class JTextField extends JTextComponent; Class JPasswordField extends JTextField.
C) Both JTextFields and JPasswordFields are single-line areas in which the user can enter text via the keyboard.
D) JPasswordFields generate events; JTextFields do not.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
22
A JRadioButton is different from a JCheckBox in that _________.

A) a JRadioButton is a subclass of JToggleButton, JCheckBox is not.
B) normally several JRadioButtons are grouped together and are mutually exclusive.
C) a JRadioButton is a type of button, JCheckBox is not.
D) a JRadioButton is a state button, JCheckBox is not.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
23
Which of the following answers does not complete the sentence correctly? An anonymous inner class__________ .

A) is frequently used for GUI event handling
B) is non-static
C) does not need a handle to its outer class to access its methods and variables
D) cannot be declared private
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
24
Which of the following choices completes the sentence correctly?
A(n)_____ is a(n)______ .

A) JToggleButton, JCheckBox
B) JToggleButton, JRadioButton
C) JButton, JToggleButton
D) JButton, AbstractButton
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
25
Every JComponent has an instance variable called ____that enables the object to maintain references to all its registered listeners.

A) registeredListenerList
B) listenerList
C) registeredList
D) eventListenerList
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
26
Which of the following most completely describes the steps for setting up event handling for a GUI component?

A) Create a class that represents the event handler, attach the JFrame to a JWindow object and register the event handler.
B) Implement an appropriate event-listener interface and register the event handler.
C) Create a class that represents the event handler and implement an appropriate event-listener interface.
D) Create a class that represents the event handler, implement an appropriate event-listener interface and register the event handler.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
27
Which of the following completes the sentence below correctly?
A(n)_____________________ is a(n)________________- .

A) InputEvent, MouseEvent.
B) ActionEvent, AdjustmentEvent.
C) FocusEvent, WindowEvent.
D) ContainerEvent, ComponentEvent.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
28
Which of the following is not necessary to use the event delegation model?

A) An event listener must be registered.
B) An event handler must be implemented.
C) The appropriate interface must be implemented.
D) The appropriate interface must be registered.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
29
The logical relationship between radio buttons is maintained by objects of what class?

A) MutualExclusionGroup
B) RadioButtonGroup
C) Group
D) ButtonGroup
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
30
Forgetting to register an event-handler object for a particular GUI component's event type causes ___________.

A) events of that type to be ignored.
B) all of the GUI component's events to be ignored.
C) a compilation error.
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
31
When the user clicks a JCheckBox, a(n)_______ occurs.

A) CheckedEvent
B) ButtonEvent
C) ItemEvent
D) ActionEvent
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
32
How many event-listener interfaces correspond to each event type?

A) one.
B) two.
C) one or more.
D) zero.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
33
Which of the following is not a type of button?

A) command buttons.
B) toggle buttons.
C) check boxes.
D) All of the above are types of buttons.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
34
The method setRolloverIcon is used to ________.

A) Handle a key event
B) Change the button text
C) Change the button icon
D) All of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
35
GUI event with which the user interacts is the ________________.

A) event effector.
B) event container.
C) event raiser.
D) event source.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
36
Which method determines if a JCheckBox is selected?

A) isSelected
B) getSelected
C) selected
D) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
37
Which of the following statements makes the text in a JTextField uneditable?

A) textField.setEditable(true);
B) textField.setEditable(false);
C) textField.setUneditable(true);
D) textField.setUneditable(false);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
38
Which of the following is stateless?

A) JButton.
B) JToggleButton.
C) JRadioButton.
D) JCheckBox.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
39
When the user presses Enter in a JPasswordField, the GUI component generates an_______ , which is processed by an object that implements the interface___________ .

A) ActionEvent, ActionListener.
B) ActionEvent, ActionEventListener.
C) TextEvent, TextListener.
D) TextEvent, TextEventListener.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
40
JPasswordField contains method ______________to obtain the data entered.

A) getInput.
B) getPassword.
C) getText.
D) getEcho.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
41
Method paintComponent is called when:

A) a lightweight Swing component is created.
B) a lightweight Swing component is displayed.
C) a lightweight Swing component is clicked.
D) an application exits.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
42
A user of a one-button mouse can simulate pushing the middle button on a three-button mouse by holding the___________ while clicking the left mouse button.

A) Alt key.
B) Meta key.
C) Ctrl key.
D) Shift key.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
43
Method getSelectedValues of class JList returns:

A) an array of ints representing the indices of the selected items.
B) an array of doubles representing the indices of the selected items.
C) an array of Strings representing the selected items.
D) an array of Objects representing the selected items.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
44
In what cases are adapter classes useful?

A) When an adapter GUI control is clicked.
B) When every method in the event-listener interface is to use the same functionality.
C) When it is not desirable to declare every method in the event-listener interface.
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
45
The setMaximumRowCount method is used for:

A) Button.
B) JComboBox.
C) JRadioButton.
D) JToggleButton.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
46
Class Point represents ________.

A) a filled oval
B) an x-y coordinate pair
C) an object used to draw
D) a period in a sentence
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
47
Adding a ButtonGroup object to a container ________.

A) is necessary for the functionality of the ButtonGroup to work properly.
B) causes all the JRadioButtons in the group to have their event handlers registered.
C) results in a compilation error.
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
48
Which of the following statements about anonymous inner classes is false?

A) They are declared without a name.
B) They typically appear inside a method declaration.
C) They are declared with the anonymous keyword.
D) They can access their top-level class's members.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
49
Which of the following is a MouseMotionListener method?

A) mousePressed.
B) mouseExited.
C) mouseDragged.
D) mouseClicked.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
50
Selecting a JList item generates ________.

A) an ActionEvent
B) a ListItemEvent
C) a ListSelectionEvent
D) a ListSelectionItemEvent
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
51
Method getSelectedIndex of class JComboBox returns:

A) the index of the selected item in the JComboBox.
B) the selected item in the JComboBox, as a String.
C) the index of the previously selected item.
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
52
Which MouseEvent method can be used to determine if the Alt key is pressed?

A) isAltPressed.
B) isAltDown.
C) getClickCount.
D) AltPressed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
53
When a component is_________- , paintComponent clears the component's background before the component is displayed.

A) transparent
B) opaque
C) oblique
D) concave
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
54
Which of the following objects cannot trap mouse events?

A) JTextField.
B) ButtonGroup.
C) JButton.
D) JComponent.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
55
When the arrow on a JComboBox is clicked:

A) an ItemEvent occurs.
B) a scrollbar always appears.
C) an ActionEvent occurs.
D) The JComboBox expands to a list.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
56
Consider the list below:
January
February
March
April
May
June
July
August
September
October
November
December
What type of JList selection mode would allow the user to select March, June and July in one step?

A) SINGLE_SELECTION.
B) SINGLE_INTERVAL_SELECTION.
C) MULTIPLE_INTERVAL_SELECTION.
D) All of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
57
The BorderLayout layout manager:

A) divides an area into five regions: NORTH, SOUTH, EAST, WEST and CENTER.
B) divides an area into five regions: UP, DOWN, LEFT, RIGHT and MIDDLE.
C) orders components vertically.
D) order components horizontally.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
58
Which of the following statements about adapters is false?

A) An adapter class implements an interface.
B) An adapter class provides a default (empty) implementation of every method in the interface.
C) Programmers override selected adapter methods.
D) A ComponentListener is a ComponentAdaptor.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
59
A JScrollPane is provided automatically for which of the following?

A) JToggleButton.
B) JRadioButton.
C) JList.
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
60
A MouseHandler object implements which two interfaces?

A) MouseListener and MouseActionListener.
B) MouseListener and MouseMotionListener.
C) MouseListener and MouseEventListener.
D) MouseListener only.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
61
Which of the following statements about JPanels is false?

A) A JPanel is a JComponent.
B) A JPanel is a Container.
C) A JPanel does not have a content pane.
D) A JPanel has a fixed size.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
62
BorderLayout implements interface ________.

A) ActionListener
B) FlowLayout.
C) Layout
D) LayoutManager2
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
63
FlowLayout is ________.

A) an abstract class
B) a way of organizing components vertically
C) the simplest layout manager
D) left-aligned by default
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
64
Using layout managers ________.

A) provides the greatest level of control over a GUI's appearance
B) can be faster than creating a GUI with absolute positioning
C) allows the programmer to specify the exact location of each GUI component with respect to the upper-left corner of the Container
D) allows the programmer to specify the exact location of each GUI component with respect to the lower-left corner of the Container
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
65
Class JTextArea's getSelectedText method ________.

A) returns the text in the JTextArea
B) returns the selected text in the JTextArea
C) displays only the selected text in the JTextArea
D) sets the selected text in the JTextArea
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
66
The Shift key is a(n)__________- key.

A) modifier
B) action
C) output
D) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
67
When components are added to a container with a GridLayout, the component ________.

A) fills the next spot in the row, continuing in the first position of the next row if the current row is full
B) fills the next spot in the column, continuing in the first position of the next column if the column is full
C) fills in row x, column y if x and y are two integers passed to the Container method add
D) fills in a random empty position in the grid
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
68
A JTextArea ________.

A) provides a bounding box used for the layout of JTextFields
B) wraps lines by default
C) provides an area for manipulating multiple lines of text
D) provides scrollbars for JTextFields
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
69
Which of the following is not a KeyListener method?

A) keyPressed.
B) keyReleased.
C) keyClicked.
D) keyTyped.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
70
Each container can have ________.

A) only one layout manager
B) one or more layout managers
C) zero or more layout managers
D) only one or two layout managers
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
71
By default JScrollPane ________.

A) always displays scrollbars
B) never displays scrollbars
C) only displays scrollbars if they are needed
D) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
72
The class GridLayout constructs to hold components.

A) a horizontal grid with one row
B) a vertical grid with one column
C) a grid with multiple rows and columns
D) a square grid with the same number of rows as columns
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
73
Which region is used by default when a Component is added to a BorderLayout?

A) NORTH
B) CENTER
C) WEST
D) LEFT
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
74
Method _________indicates that a Component should be refreshed on screen as soon as possible with a call to that control's paintComponent method.

A) refresh
B) repaint
C) repaintComponent
D) redraw
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
75
All layout managers implement the interface ________.

A) LayoutInterface
B) InterfaceLayoutManager
C) LayoutManagerInterface
D) LayoutManager
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
76
Which layout manager is the default for JFrame?

A) FlowLayout
B) BorderLayout
C) GridLayout
D) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
77
Which methods can be used to change the scrollbar policies?

A) setHoizontalPolicy, setVerticalPolicy.
B) setHorizontal, setVertical.
C) setHPolicy, setVPolicy.
D) setHorizontalScrollBarPolicy, setVerticalScrollBarPolicy.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
78
FlowLayout method_________ changes the alignment for the FlowLayout.

A) setLayout
B) modifyAlignment
C) setAlignment
D) setAlign
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 78 في هذه المجموعة.