Deck 13: Advanced GUI Applications

ملء الشاشة (f)
exit full mode
سؤال
What will be the results of executing the following statements?
X)setEditable(true);
X)setText("Tiny Tim");

A) The text field x will have the value "Tiny Tim" and be read-only.
B) The text field x will have the value "Tiny Tim" and the user will be able to change its value.
C) The text field x will have the value true.
D) The text field x have the value "trueTiny Tim"
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
If the combo box addressBox contains a list of strings, why is the returned value of getSelectedItem method in the following code cast to String?
String selectedAddress;
SelectedAddress = (String)addressBox.getSelectedItem();

A) This is not necessary.
B) Because the syntax of the method requires it
C) It makes the program more readable.
D) Because the return type of the method is an Object
سؤال
A mnemonic is:

A) A single key on the keyboard that you press to quickly access a component such as a button
B) A key on the keyboard that you press in combination with the SHIFT key to quickly access a component such as a button
C) A key on the keyboard that you press in combination with the ALT key to quickly access a component such as a button
D) A key on the keyboard that you press in combination with the CTRL key to quickly access a component such as a button
سؤال
The default directory for the JFileChooser constructor is:

A) Your login directory if you are using UNIX
B) Probably My Documents if you are using Windows
C) Neither A nor B
D) Both A and B
سؤال
To force the JFrame that encloses a window to resize itself automatically when a larger object is placed in the frame, use:

A) the pack method
B) the resize method
C) the grow method
D) the enlarge method
سؤال
A text field that can be changed by code in the application, but cannot be edited by the user is known as what?

A) Write-only
B) Static
C) Read-only
D) Formal
سؤال
To add a tool tip to a component use:

A) the setToolTipText method
B) the addToolTipText method
C) the toolTipText method
D) the appendToolTipText method
سؤال
This type of combo box combines a button with a list and allows the user to select items from its list only.

A) Editable
B) Static
C) Bound
D) Uneditable
سؤال
The ImageIcon class supports all the following file types, EXCEPT:

A) BMP
B) JPEG
C) GIF
D) PNG
سؤال
To add the JList object addressList to a scroll pane named scrollPane, use the following:

A) JScrollPane scrollPane = new JScrollPane(addressList);
B) scrollPane.add(addressList);
C) addressList.add(scrollPane);
D) addressList.addScrollPane(scrollPane);
سؤال
If addressList is a JList component, what will the value of x be after the following statement is executed?
X = addressList.getSelectedIndex();

A) The value of the first selected item
B) The index of the first selected item
C) An array of objects containing the items selected
D) An array containing the indices of all the selected items in the list
سؤال
A menu system may consist of each of the following, EXCEPT:

A) check box menu item
B) combo box menu item
C) radio button menu item
D) menu item
سؤال
If a user enters a value in the text box of an editable combo box and the value is NOT in the list, what will the method getSelectedIndex return?

A) The index of the item that the user replaced
B) The index of the item the user entered
C) -1
D) 0, since the item is not in the list
سؤال
To determine which item in a list is currently selected use:

A) the getSelectedIndex method
B) the getSelectedValue method
C) both A and B
D) neither A nor B
سؤال
Java provides this component for creating lists:

A) JColumn
B) JList
C) JPanel
D) JFrame
سؤال
What will happen when the following code is executed?
JPanel panel = new JPanel();
Color selectedColor;
SelectedColor = JColorChooser.showDialog(null,
"Select color", Color.BLUE);

A) A Color Chooser will be displayed in the upper, left-hand corner of the screen with "Select color" in its Title Bar and blue pre-selected.
B) A Color Chooser will be displayed in the center of the screen with "Select color" in its Title Bar and blue pre-selected.
C) A Color Chooser will be displayed in the center of the screen with "Select color" as the OK button's text and blue pre-selected.
D) A Color Chooser will be displayed in the lower, right-hand corner of the screen with "Select color" in its Title Bar and blue pre-selected.
سؤال
When an item in a Jlist object is selected it generates a(n):

A) action listener event
B) action performed event
C) list selection listener event
D) list selection event
سؤال
When an item in the combo box is selected, the combo box executes its action event listener's actionPerformed method, passing:

A) an ItemEvent object as an argurment.
B) a SelectionEvent object as an argurment.
C) an ActionEvent object as an argument.
D) the combo box as an argument.
سؤال
What will display when the following code is executed: JLabel label = new JLabel ("It is a beautiful morning.");
Labed.setIcon(SunnyFace.gif);

A) A label with the text "It is a beautiful day." to the left of the SunnyFace image
B) A label with the text "It is a beautiful day." to the right of the SunnyFace image
C) A label with the text "It is a beautiful day." below the SunnyFace image
D) A label with the text "It is a beautiful day." above the SunnyFace image
سؤال
The default selection mode for a JList component is:

A) single selection
B) single interval selection
C) multiple interval selection
D) There is no default setting.
سؤال
What will the following code do when it is executed?
JTextArea message = JTextArea(greetings, 50, 70);
JScrollPane scrollPane = new JScrollPane(message);

A) It will create a JScrollPane object for the JTextArea object referenced by message and display a horizontal scroll bar on the text area.
B) It will create a JScrollPane object for the JTextArea object referenced by message and display a vertical scroll bar on the text area.
C) It will create a JScrollPane object for the JTextArea object referenced by message and display both vertical and horizontal scroll bars on the text area.
D) It will create a JScrollPane object for the JTextArea object referenced by message and display no scroll bars on the text area.
سؤال
The JComboBox class is in the:

A) javax.swing package
B) java.awt package
C) java awt.event package
D) java.swing.event package
سؤال
If the letter chosen as the mnemonic is in the component's text, the first occurrence of that letter will appear ________ when the component is displayed.

A) bolded
B) italicized
C) underlined
D) all of the above
سؤال
What will display 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();

A) The JFrame that encloses the window will resize itself to accommodate the SunnyFace image.
B) imagePanel will resize itself to accommodate the SunnyFace image.
C) The SunnyFace image will resize itself to fit on imageLabel.
D) The SunnyFace image will resize itself to fit on imagePanel.
سؤال
When you create an instance of the JList class:

A) you pass an array of objects to the constructor
B) the list has a default selection mode of Single Selection Mode
C) the values in the list are automatically sorted
D) you must indicate the maximum number of list items the user may select at any one time
سؤال
If a user enters a value in the text box of an editable combo box and the value is NOT in the list, what will the method getSelectedItem return?

A) The value that the user replaced
B) The index of the item the user entered
C) The value that appears in the text field, even if it is not in the combo box's list
D) Nothing, since the item is not in the list
سؤال
The Dimension class is part of the:

A) javax.swing.event package
B) java.awt.menu package
C) javax.swing package
D) java.awt package
سؤال
A tool tip is:

A) a guide provided by the Help menu as to which tool to use for various programming techniques
B) another name for the Tool Bar
C) used to make programming easier
D) text that is displayed in a small box when the user holds the mouse cursor over a component
سؤال
This is a specialized dialog box that allows the user to select a color from a predefined palette of colors.

A) Hue picker
B) Color chooser
C) Paint dialog box
D) Palette selector
سؤال
If nameList is a JList component, use the following statement to display 4 rows in nameList.

A) nameList.setRowCount(4);
B) nameList.setDisplayRowCount(4);
C) nameList.setShowRowCount(4);
D) nameList.setVisibleRowCount(4);
سؤال
The getSelectedIndex method returns:

A) the index of the selected item
B) -1 if no item is selected
C) both A and B
D) neither A nor B
سؤال
Images may be displayed in labels and:

A) lists
B) buttons
C) combo boxes
D) panels
سؤال
The ImageIcon class constructor accepts:

A) an integer that references the image
B) a String argument which is the name of the image file
C) a String argument which is the name of the image
D) It does not accept any arguments.
سؤال
Which of the following assigns ALT+C as a mnemonic key for the JButton object, clearButton?

A) clearButton.addMnemonic(KeyEvent.VK_C);
B) clearButton.setMnemonic(KeyEvent.C);
C) clearButton.setMnemonic(KeyEvent.VK_C);
D) clearButton.assignMnemonic(KeyEvent.VK_C);
سؤال
A ________ object specifies a component's width and height.

A) Container
B) Region
C) Frame
D) Dimension
سؤال
What will happen when the following statement is executed?
X)setEditable(False);

A) The boolean variable x will be set to False.
B) The text field x will be made read-only.
C) The text field x will be editable.
D) The boolean variable x will be editable.
سؤال
The following statement: textList.setSelectionMode(
ListSelectModel.SINGLE_INTERVAL_SELECTION);

A) sets the textList component to single selection mode
B) sets the textList component to ListSelectModel
C) sets the textList component to single interval selection mode
D) sets the value of textList to SINGLE_INTERVAL_SELECTION
سؤال
If addressList exists and has values stored in it and addrList is an array with values stored in it, what will be the results when the following code is executed?
AddressList.setListData(addrList);

A) The values of addrList will be attached at the end of the current addressList.
B) The values in addressList will be replaced by the values in addrList.
C) The values of addrList will be inserted at the beginning of the current addressList.
D) addressList will be unchanged.
سؤال
What will display when the following code is executed?
JButton button =
New JButton ("It is a beautiful day.");
Button.setIcon(SunnyFace.gif);

A) A button with the text "It is a beautiful day." to the left of the SunnyFace image
B) A button with the text "It is a beautiful day." to the right of the SunnyFace image
C) A button with the text "It is a beautiful day." below the SunnyFace image
D) A button with the text "It is a beautiful day." above the SunnyFace image
سؤال
Which of the following is NOT a class used in constructing a menu system?

A) JMenuItem
B) JCheckBoxMenuItem
C) JButton
D) JRadioButtonMenuItem
سؤال
When you write a change listener class method for a slider, it must implement the ChangeListener interface which is in the javax.swing.event package.
سؤال
The JMenuBar method is a(n):

A) JFrame method
B) JPanel method
C) JMenu method
D) JTextComponent method
سؤال
In the following code the setPreferredSize method sets the size of the text, "Have a good day".
label = new Jlabel("Have a good day", SwingConstants.CENTER);
label.setPreferredSize(new Dimension(400,200));
سؤال
When a JList component is added to a JScrollPane object, a border will automatically appear around the list.
سؤال
A menu system may consist of each of the following EXCEPT:

A) menu item
B) separator bar
C) menu bar
D) It may have all the above.
سؤال
What will be the results of executing the following code, if the user simply clicks OK?
JPanel panel = new JPanel();
Color selectedColor;
SelectedColor = JColorChooser.showDialog(null,
"Select color", Color.blue);
Panel.setForeground(selectedColor);

A) The foreground color will remain unchanged.
B) The foreground color will be set to white.
C) The foreground color will be set to black.
D) The foreground color will be set to blue.
سؤال
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?

A) JSlider slider = new JSlider(0, 50, 25, JSlider.HORIZONTAL);
B) JSlider slider = new JSlider(JSlider.HORIZONTAL, 0, 50, 25);
C) JSlider slider = new JSlider(JSlider.HORIZONTAL, 25, 0, 50);
D) JSlider slider = new JSlider(JSlider.HORIZONTAL, 50, 0, 25);
سؤال
Which of the following is NOT a class used in constructing a menu system?

A) JMenuItem
B) JCheckBoxMenuItem
C) JComboBoxMenuItem
D) JRadioButtonMenuItem
سؤال
A label's preferred size is determined only by calling the setPreferredSize method.
سؤال
A menu within a menu is called what?

A) Nested menu
B) Submenu
C) Recursive menu
D) Formal list
سؤال
If the argument passed to the showOpenDialog method is null:

A) the dialog box will normally be displayed in the upper, left-hand corner of the screen.
B) the dialog box will normally be centered in the screen.
C) nothing will be displayed because there was nothing passed to the method.
D) -1 will be returned from the method.
سؤال
By default the scroll bars are always displayed in a JList component.
سؤال
A read-only text field uses the JReadOnlyTextField component.
سؤال
When creating images, the argument passed to the image parameter in the JLabel constructor can be an ImageIcon object, or any object that implements the Icon interface.
سؤال
When using a slider, by default, tick marks are not displayed, and setting their spacing does not cause them to be displayed.
سؤال
What does the following statement do?
JTextArea textField = JTextArea(message, 25, 15);

A) It creates a text area with 25 columns and 15 rows that will initially display the text stored in the String object message.
B) It creates a text area with 25 columns and 15 rows that will initially display the text stored in the text area textField.
C) It creates a text area with 25 rows and 15 columns that will initially display the text stored in the String object message.
D) It creates a text area with 25 rows and 15 columns that will initially display the text "message".
سؤال
Both AWT classes and Swing classes ultimately inherit from the Component class.
سؤال
You can create a label with an image, or with both an image and text.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/58
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 13: Advanced GUI Applications
1
What will be the results of executing the following statements?
X)setEditable(true);
X)setText("Tiny Tim");

A) The text field x will have the value "Tiny Tim" and be read-only.
B) The text field x will have the value "Tiny Tim" and the user will be able to change its value.
C) The text field x will have the value true.
D) The text field x have the value "trueTiny Tim"
B
2
If the combo box addressBox contains a list of strings, why is the returned value of getSelectedItem method in the following code cast to String?
String selectedAddress;
SelectedAddress = (String)addressBox.getSelectedItem();

A) This is not necessary.
B) Because the syntax of the method requires it
C) It makes the program more readable.
D) Because the return type of the method is an Object
D
3
A mnemonic is:

A) A single key on the keyboard that you press to quickly access a component such as a button
B) A key on the keyboard that you press in combination with the SHIFT key to quickly access a component such as a button
C) A key on the keyboard that you press in combination with the ALT key to quickly access a component such as a button
D) A key on the keyboard that you press in combination with the CTRL key to quickly access a component such as a button
C
4
The default directory for the JFileChooser constructor is:

A) Your login directory if you are using UNIX
B) Probably My Documents if you are using Windows
C) Neither A nor B
D) Both A and B
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
5
To force the JFrame that encloses a window to resize itself automatically when a larger object is placed in the frame, use:

A) the pack method
B) the resize method
C) the grow method
D) the enlarge method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
6
A text field that can be changed by code in the application, but cannot be edited by the user is known as what?

A) Write-only
B) Static
C) Read-only
D) Formal
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
7
To add a tool tip to a component use:

A) the setToolTipText method
B) the addToolTipText method
C) the toolTipText method
D) the appendToolTipText method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
8
This type of combo box combines a button with a list and allows the user to select items from its list only.

A) Editable
B) Static
C) Bound
D) Uneditable
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
9
The ImageIcon class supports all the following file types, EXCEPT:

A) BMP
B) JPEG
C) GIF
D) PNG
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
10
To add the JList object addressList to a scroll pane named scrollPane, use the following:

A) JScrollPane scrollPane = new JScrollPane(addressList);
B) scrollPane.add(addressList);
C) addressList.add(scrollPane);
D) addressList.addScrollPane(scrollPane);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
11
If addressList is a JList component, what will the value of x be after the following statement is executed?
X = addressList.getSelectedIndex();

A) The value of the first selected item
B) The index of the first selected item
C) An array of objects containing the items selected
D) An array containing the indices of all the selected items in the list
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
12
A menu system may consist of each of the following, EXCEPT:

A) check box menu item
B) combo box menu item
C) radio button menu item
D) menu item
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
13
If a user enters a value in the text box of an editable combo box and the value is NOT in the list, what will the method getSelectedIndex return?

A) The index of the item that the user replaced
B) The index of the item the user entered
C) -1
D) 0, since the item is not in the list
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
14
To determine which item in a list is currently selected use:

A) the getSelectedIndex method
B) the getSelectedValue method
C) both A and B
D) neither A nor B
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
15
Java provides this component for creating lists:

A) JColumn
B) JList
C) JPanel
D) JFrame
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
16
What will happen when the following code is executed?
JPanel panel = new JPanel();
Color selectedColor;
SelectedColor = JColorChooser.showDialog(null,
"Select color", Color.BLUE);

A) A Color Chooser will be displayed in the upper, left-hand corner of the screen with "Select color" in its Title Bar and blue pre-selected.
B) A Color Chooser will be displayed in the center of the screen with "Select color" in its Title Bar and blue pre-selected.
C) A Color Chooser will be displayed in the center of the screen with "Select color" as the OK button's text and blue pre-selected.
D) A Color Chooser will be displayed in the lower, right-hand corner of the screen with "Select color" in its Title Bar and blue pre-selected.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
17
When an item in a Jlist object is selected it generates a(n):

A) action listener event
B) action performed event
C) list selection listener event
D) list selection event
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
18
When an item in the combo box is selected, the combo box executes its action event listener's actionPerformed method, passing:

A) an ItemEvent object as an argurment.
B) a SelectionEvent object as an argurment.
C) an ActionEvent object as an argument.
D) the combo box as an argument.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
19
What will display when the following code is executed: JLabel label = new JLabel ("It is a beautiful morning.");
Labed.setIcon(SunnyFace.gif);

A) A label with the text "It is a beautiful day." to the left of the SunnyFace image
B) A label with the text "It is a beautiful day." to the right of the SunnyFace image
C) A label with the text "It is a beautiful day." below the SunnyFace image
D) A label with the text "It is a beautiful day." above the SunnyFace image
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
20
The default selection mode for a JList component is:

A) single selection
B) single interval selection
C) multiple interval selection
D) There is no default setting.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
21
What will the following code do when it is executed?
JTextArea message = JTextArea(greetings, 50, 70);
JScrollPane scrollPane = new JScrollPane(message);

A) It will create a JScrollPane object for the JTextArea object referenced by message and display a horizontal scroll bar on the text area.
B) It will create a JScrollPane object for the JTextArea object referenced by message and display a vertical scroll bar on the text area.
C) It will create a JScrollPane object for the JTextArea object referenced by message and display both vertical and horizontal scroll bars on the text area.
D) It will create a JScrollPane object for the JTextArea object referenced by message and display no scroll bars on the text area.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
22
The JComboBox class is in the:

A) javax.swing package
B) java.awt package
C) java awt.event package
D) java.swing.event package
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
23
If the letter chosen as the mnemonic is in the component's text, the first occurrence of that letter will appear ________ when the component is displayed.

A) bolded
B) italicized
C) underlined
D) all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
24
What will display 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();

A) The JFrame that encloses the window will resize itself to accommodate the SunnyFace image.
B) imagePanel will resize itself to accommodate the SunnyFace image.
C) The SunnyFace image will resize itself to fit on imageLabel.
D) The SunnyFace image will resize itself to fit on imagePanel.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
25
When you create an instance of the JList class:

A) you pass an array of objects to the constructor
B) the list has a default selection mode of Single Selection Mode
C) the values in the list are automatically sorted
D) you must indicate the maximum number of list items the user may select at any one time
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
26
If a user enters a value in the text box of an editable combo box and the value is NOT in the list, what will the method getSelectedItem return?

A) The value that the user replaced
B) The index of the item the user entered
C) The value that appears in the text field, even if it is not in the combo box's list
D) Nothing, since the item is not in the list
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
27
The Dimension class is part of the:

A) javax.swing.event package
B) java.awt.menu package
C) javax.swing package
D) java.awt package
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
28
A tool tip is:

A) a guide provided by the Help menu as to which tool to use for various programming techniques
B) another name for the Tool Bar
C) used to make programming easier
D) text that is displayed in a small box when the user holds the mouse cursor over a component
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
29
This is a specialized dialog box that allows the user to select a color from a predefined palette of colors.

A) Hue picker
B) Color chooser
C) Paint dialog box
D) Palette selector
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
30
If nameList is a JList component, use the following statement to display 4 rows in nameList.

A) nameList.setRowCount(4);
B) nameList.setDisplayRowCount(4);
C) nameList.setShowRowCount(4);
D) nameList.setVisibleRowCount(4);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
31
The getSelectedIndex method returns:

A) the index of the selected item
B) -1 if no item is selected
C) both A and B
D) neither A nor B
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
32
Images may be displayed in labels and:

A) lists
B) buttons
C) combo boxes
D) panels
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
33
The ImageIcon class constructor accepts:

A) an integer that references the image
B) a String argument which is the name of the image file
C) a String argument which is the name of the image
D) It does not accept any arguments.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
34
Which of the following assigns ALT+C as a mnemonic key for the JButton object, clearButton?

A) clearButton.addMnemonic(KeyEvent.VK_C);
B) clearButton.setMnemonic(KeyEvent.C);
C) clearButton.setMnemonic(KeyEvent.VK_C);
D) clearButton.assignMnemonic(KeyEvent.VK_C);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
35
A ________ object specifies a component's width and height.

A) Container
B) Region
C) Frame
D) Dimension
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
36
What will happen when the following statement is executed?
X)setEditable(False);

A) The boolean variable x will be set to False.
B) The text field x will be made read-only.
C) The text field x will be editable.
D) The boolean variable x will be editable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
37
The following statement: textList.setSelectionMode(
ListSelectModel.SINGLE_INTERVAL_SELECTION);

A) sets the textList component to single selection mode
B) sets the textList component to ListSelectModel
C) sets the textList component to single interval selection mode
D) sets the value of textList to SINGLE_INTERVAL_SELECTION
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
38
If addressList exists and has values stored in it and addrList is an array with values stored in it, what will be the results when the following code is executed?
AddressList.setListData(addrList);

A) The values of addrList will be attached at the end of the current addressList.
B) The values in addressList will be replaced by the values in addrList.
C) The values of addrList will be inserted at the beginning of the current addressList.
D) addressList will be unchanged.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
39
What will display when the following code is executed?
JButton button =
New JButton ("It is a beautiful day.");
Button.setIcon(SunnyFace.gif);

A) A button with the text "It is a beautiful day." to the left of the SunnyFace image
B) A button with the text "It is a beautiful day." to the right of the SunnyFace image
C) A button with the text "It is a beautiful day." below the SunnyFace image
D) A button with the text "It is a beautiful day." above the SunnyFace image
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
40
Which of the following is NOT a class used in constructing a menu system?

A) JMenuItem
B) JCheckBoxMenuItem
C) JButton
D) JRadioButtonMenuItem
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
41
When you write a change listener class method for a slider, it must implement the ChangeListener interface which is in the javax.swing.event package.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
42
The JMenuBar method is a(n):

A) JFrame method
B) JPanel method
C) JMenu method
D) JTextComponent method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
43
In the following code the setPreferredSize method sets the size of the text, "Have a good day".
label = new Jlabel("Have a good day", SwingConstants.CENTER);
label.setPreferredSize(new Dimension(400,200));
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
44
When a JList component is added to a JScrollPane object, a border will automatically appear around the list.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
45
A menu system may consist of each of the following EXCEPT:

A) menu item
B) separator bar
C) menu bar
D) It may have all the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
46
What will be the results of executing the following code, if the user simply clicks OK?
JPanel panel = new JPanel();
Color selectedColor;
SelectedColor = JColorChooser.showDialog(null,
"Select color", Color.blue);
Panel.setForeground(selectedColor);

A) The foreground color will remain unchanged.
B) The foreground color will be set to white.
C) The foreground color will be set to black.
D) The foreground color will be set to blue.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
47
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?

A) JSlider slider = new JSlider(0, 50, 25, JSlider.HORIZONTAL);
B) JSlider slider = new JSlider(JSlider.HORIZONTAL, 0, 50, 25);
C) JSlider slider = new JSlider(JSlider.HORIZONTAL, 25, 0, 50);
D) JSlider slider = new JSlider(JSlider.HORIZONTAL, 50, 0, 25);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
48
Which of the following is NOT a class used in constructing a menu system?

A) JMenuItem
B) JCheckBoxMenuItem
C) JComboBoxMenuItem
D) JRadioButtonMenuItem
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
49
A label's preferred size is determined only by calling the setPreferredSize method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
50
A menu within a menu is called what?

A) Nested menu
B) Submenu
C) Recursive menu
D) Formal list
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
51
If the argument passed to the showOpenDialog method is null:

A) the dialog box will normally be displayed in the upper, left-hand corner of the screen.
B) the dialog box will normally be centered in the screen.
C) nothing will be displayed because there was nothing passed to the method.
D) -1 will be returned from the method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
52
By default the scroll bars are always displayed in a JList component.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
53
A read-only text field uses the JReadOnlyTextField component.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
54
When creating images, the argument passed to the image parameter in the JLabel constructor can be an ImageIcon object, or any object that implements the Icon interface.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
55
When using a slider, by default, tick marks are not displayed, and setting their spacing does not cause them to be displayed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
56
What does the following statement do?
JTextArea textField = JTextArea(message, 25, 15);

A) It creates a text area with 25 columns and 15 rows that will initially display the text stored in the String object message.
B) It creates a text area with 25 columns and 15 rows that will initially display the text stored in the text area textField.
C) It creates a text area with 25 rows and 15 columns that will initially display the text stored in the String object message.
D) It creates a text area with 25 rows and 15 columns that will initially display the text "message".
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
57
Both AWT classes and Swing classes ultimately inherit from the Component class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
58
You can create a label with an image, or with both an image and text.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.