Deck 14: Gui Components: Part 1

ملء الشاشة (f)
exit full mode
سؤال
Which component contains menus?

A)Menu button.
B)Title bar.
C)Menu bar.
D)Combo box.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Which of the following is the method used to display a dialog box to gather input?

A)showMessageDialog.
B)getInput.
C)inputDialog.
D)showInputDialog.
سؤال
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.
سؤال
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.
سؤال
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.
سؤال
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 pair of words does not complete the sentence below correctly? A ________ is a ________.

A)Container,Component.
B)Container,JPanel.
C)JComponent,Container.
D)Component,Object.
سؤال
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 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 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 expression returns the location of a file as a URL?

A)getURL( "file.txt" ).
B)getResource( "file.txt" ).
C)findResource( "file.txt" ).
D)getClass( "file.txt" ).
سؤال
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.
سؤال
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 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.
سؤال
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.
سؤال
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 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 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.
سؤال
A JLabel can be attached to a JFrame using method:

A)attach.
B)contain.
C)append.
D)add.
سؤال
The logical relationship between radio buttons is maintained by objects of what class?

A)MutualExclusionGroup.
B)RadioButtonGroup.
C)Group.
D)ButtonGroup.
سؤال
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.
سؤال
JPasswordField contains method to obtain the data entered.

A)getInput.
B)getPassword.
C)getText.
D)getEcho.
سؤال
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.
سؤال
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.
سؤال
How many event-listener interfaces correspond to each event type?

A)one.
B)two.
C)one or more.
D)zero.
سؤال
The GUI event with which the user interacts is the .

A)event effector.
B)event container.
C)event raiser.
D)event source.
سؤال
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.
سؤال
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.
سؤال
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.
سؤال
Which method determines if a JCheckBox is selected?

A)isSelected.
B)getSelected.
C)selected.
D)None of the above.
سؤال
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 statements makes the text in a JTextField uneditable?

A)textField.setEditable( true );
B)textField.setEditable( false );
C)textField.setUneditable( true );
D)textField.setUneditable( false );
سؤال
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 choices completes the sentence correctly? A(n) is a(n) .

A)JToggleButton,JCheckBox.
B)JToggleButton,JRadioButton.
C)JButton,JToggleButton.
D)JButton,AbstractButton.
سؤال
When the user clicks a JCheckBox,a(n) occurs.

A)CheckedEvent.
B)ButtonEvent.
C)ItemEvent.
D)ActionEvent.
سؤال
Which of the following is stateless?

A)JButton.
B)JToggleButton.
C)JRadioButton.
D)JCheckBox.
سؤال
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.
سؤال
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.
سؤال
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.
سؤال
Which of the following is a MouseMotionListener method?

A)mousePressed.
B)mouseExited.
C)mouseDragged.
D)mouseClicked.
سؤال
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.
سؤال
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.
سؤال
The setMaximumRowCount method is used for:

A)Button.
B)JComboBox.
C)JRadioButton.
D)JToggleButton.
سؤال
A MouseHandler object implements which two interfaces?

A)MouseListener and MouseActionListener.
B)MouseListener and MouseMotionListener.
C)MouseListener and MouseEventListener.
D)MouseListener only.
سؤال
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.
سؤال
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.
سؤال
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.
سؤال
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.
سؤال
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.
سؤال
Selecting a JList item generates:

A)an ActionEvent.
B)a ListItemEvent.
C)a ListSelectionEvent.
D)a ListSelectionItemEvent.
سؤال
A JScrollPane is provided automatically for which of the following?

A)JToggleButton.
B)JRadioButton.
C)JList.
D)None of the above.
سؤال
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 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 MouseEvent method can be used to determine if the Alt key is pressed?

A)isAltPressed.
B)isAltDown.
C)getClickCount.
D)AltPressed.
سؤال
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 objects cannot trap mouse events?

A)JTextField.
B)ButtonGroup.
C)JButton.
D)JComponent.
سؤال
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.
سؤال
Class Point represents:

A)a filled oval.
B)an x-y coordinate.
C)an object used to draw.
D)a period in a sentence.
سؤال
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 Shift key is a(n) key.

A)modifier.
B)action.
C)output.
D)None of the above.
سؤال
FlowLayout method changes the alignment for the FlowLayout.

A)setLayout.
B)modifyAlignment.
C)setAlignment.
D)setAlign.
سؤال
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.
سؤال
Which region is used by default when a Component is added to a BorderLayout?

A)NORTH.
B)CENTER.
C)WEST.
D)LEFT.
سؤال
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.
سؤال
All layout managers implement the interface:

A)LayoutInterface.
B)InterfaceLayoutManager.
C)LayoutManagerInterface.
D)LayoutManager.
سؤال
Which methods can be used to change the scrollbar policies?

A)setHoizontalPolicy,setVerticalPolicy.
B)setHorizontal,setVertical.
C)setHPolicy,setVPolicy.
D)setHorizontalScrollBarPolicy,setVerticalScrollBarPolicy.
سؤال
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.
سؤال
Which of the following is not a KeyListener method?

A)keyPressed.
B)keyReleased.
C)keyClicked.
D)keyTyped.
سؤال
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 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.
سؤال
Which layout manager is the default for JFrame?

A)FlowLayout.
B)BorderLayout.
C)GridLayout.
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.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/77
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 14: Gui Components: Part 1
1
Which component contains menus?

A)Menu button.
B)Title bar.
C)Menu bar.
D)Combo box.
C
2
Which of the following is the method used to display a dialog box to gather input?

A)showMessageDialog.
B)getInput.
C)inputDialog.
D)showInputDialog.
D
3
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.
C
4
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
5
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
6
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
7
Which pair of words does not complete the sentence below correctly? A ________ is a ________.

A)Container,Component.
B)Container,JPanel.
C)JComponent,Container.
D)Component,Object.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
8
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
9
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
10
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
11
Which expression returns the location of a file as a URL?

A)getURL( "file.txt" ).
B)getResource( "file.txt" ).
C)findResource( "file.txt" ).
D)getClass( "file.txt" ).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
12
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
13
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 )
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
14
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
15
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
16
Which method sets the text that's displayed when the user hovers over a JLabel?

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

A)String.
B)Button.
C)Menu.
D)Combo box.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
18
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
19
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
20
A JLabel can be attached to a JFrame using method:

A)attach.
B)contain.
C)append.
D)add.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
21
The logical relationship between radio buttons is maintained by objects of what class?

A)MutualExclusionGroup.
B)RadioButtonGroup.
C)Group.
D)ButtonGroup.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
22
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
23
JPasswordField contains method to obtain the data entered.

A)getInput.
B)getPassword.
C)getText.
D)getEcho.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
24
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
25
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
26
How many event-listener interfaces correspond to each event type?

A)one.
B)two.
C)one or more.
D)zero.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
27
The GUI event with which the user interacts is the .

A)event effector.
B)event container.
C)event raiser.
D)event source.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
29
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
30
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
31
Which method determines if a JCheckBox is selected?

A)isSelected.
B)getSelected.
C)selected.
D)None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
32
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
33
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
34
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 );
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
35
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
36
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
37
When the user clicks a JCheckBox,a(n) occurs.

A)CheckedEvent.
B)ButtonEvent.
C)ItemEvent.
D)ActionEvent.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
38
Which of the following is stateless?

A)JButton.
B)JToggleButton.
C)JRadioButton.
D)JCheckBox.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
39
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
40
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
42
Which of the following is a MouseMotionListener method?

A)mousePressed.
B)mouseExited.
C)mouseDragged.
D)mouseClicked.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
44
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
45
The setMaximumRowCount method is used for:

A)Button.
B)JComboBox.
C)JRadioButton.
D)JToggleButton.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
46
A MouseHandler object implements which two interfaces?

A)MouseListener and MouseActionListener.
B)MouseListener and MouseMotionListener.
C)MouseListener and MouseEventListener.
D)MouseListener only.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
47
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
48
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
49
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
50
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
51
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
52
Selecting a JList item generates:

A)an ActionEvent.
B)a ListItemEvent.
C)a ListSelectionEvent.
D)a ListSelectionItemEvent.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
53
A JScrollPane is provided automatically for which of the following?

A)JToggleButton.
B)JRadioButton.
C)JList.
D)None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
54
When a component is ,paintComponent clears the component's background before the component is displayed.

A)transparent.
B)opaque.
C)oblique.
D)concave.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
55
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
56
Which MouseEvent method can be used to determine if the Alt key is pressed?

A)isAltPressed.
B)isAltDown.
C)getClickCount.
D)AltPressed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
57
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
58
Which of the following objects cannot trap mouse events?

A)JTextField.
B)ButtonGroup.
C)JButton.
D)JComponent.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
59
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
60
Class Point represents:

A)a filled oval.
B)an x-y coordinate.
C)an object used to draw.
D)a period in a sentence.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
61
By default JScrollPane:

A)always displays scrollbars.
B)never displays scrollbars.
C)only displays scrollbars if they are needed.
D)None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
62
The Shift key is a(n) key.

A)modifier.
B)action.
C)output.
D)None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
63
FlowLayout method changes the alignment for the FlowLayout.

A)setLayout.
B)modifyAlignment.
C)setAlignment.
D)setAlign.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
64
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
65
Which region is used by default when a Component is added to a BorderLayout?

A)NORTH.
B)CENTER.
C)WEST.
D)LEFT.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
66
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
67
All layout managers implement the interface:

A)LayoutInterface.
B)InterfaceLayoutManager.
C)LayoutManagerInterface.
D)LayoutManager.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
68
Which methods can be used to change the scrollbar policies?

A)setHoizontalPolicy,setVerticalPolicy.
B)setHorizontal,setVertical.
C)setHPolicy,setVPolicy.
D)setHorizontalScrollBarPolicy,setVerticalScrollBarPolicy.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
69
BorderLayout implements interface:

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

A)an abstract class.
B)a way of organizing components vertically.
C)the simplest layout manager.
D)left-aligned by default.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
71
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
72
Which of the following is not a KeyListener method?

A)keyPressed.
B)keyReleased.
C)keyClicked.
D)keyTyped.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
73
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
74
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
75
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
76
Which layout manager is the default for JFrame?

A)FlowLayout.
B)BorderLayout.
C)GridLayout.
D)None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
77
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 77 في هذه المجموعة.