Deck 11: GUI Applications–Part 1
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/40
العب
ملء الشاشة (f)
Deck 11: GUI Applications–Part 1
1
What does JFC stand for?
A) Java Frame Class
B) Java Fundamental Core
C) Java Fundamental Classes
D) Java Foundation Classes
A) Java Frame Class
B) Java Fundamental Core
C) Java Fundamental Classes
D) Java Foundation Classes
D
2
This method of the JOptionPane class is used to display a confirm dialog box.
A) showConfirmDialog
B) showConfirmationDialog
C) showConDialog
D) showCDialog
A) showConfirmDialog
B) showConfirmationDialog
C) showConDialog
D) showCDialog
A
3
In a Swing application, you create a frame from this class.
A) JFrame
B) JPanel
C) JLabel
D) JButton
A) JFrame
B) JPanel
C) JLabel
D) JButton
A
4
A JFrame object's content pane is automatically given a ________ manager.
A) BorderLayout
B) GridLayout
C) FlowLayout
D) RegionLayout
A) BorderLayout
B) GridLayout
C) FlowLayout
D) RegionLayout
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
5
________, which may appear alone or in groups, allow the user to make yes/no or on/off selections.
A) Active panels
B) Toggle buttons
C) Radio buttons
D) Check boxes
A) Active panels
B) Toggle buttons
C) Radio buttons
D) Check boxes
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
6
Very few of the Swing components are coupled with peers, so they are called ________ components.
A) peerless
B) fixed
C) singular
D) lightweight
A) peerless
B) fixed
C) singular
D) lightweight
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
7
This layout manager arranges components in rows.
A) RegionLayout
B) BorderLayout
C) FlowLayout
D) GridLayout
A) RegionLayout
B) BorderLayout
C) FlowLayout
D) GridLayout
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
8
If panel references a JPanel object, which of the following statements adds the GridLayout to it?
A) panel.GridLayout(2,3);
B) panel.addLayout(new GridLayout(2,3));
C) panel.attachLayout(GridLayout(2,3));
D) panel.setLayout(new GridLayout(2,3));
A) panel.GridLayout(2,3);
B) panel.addLayout(new GridLayout(2,3));
C) panel.attachLayout(GridLayout(2,3));
D) panel.setLayout(new GridLayout(2,3));
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
9
The ________ manager creates a grid with rows and columns, much like a spreadsheet.
A) RegionLayout
B) GridLayout
C) FlowLayout
D) BorderLayout
A) RegionLayout
B) GridLayout
C) FlowLayout
D) BorderLayout
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
10
Event listeners must
A) exit the application once it has handled the event.
B) not receive any arguments.
C) be included in private inner classes.
D) implement an interface.
A) exit the application once it has handled the event.
B) not receive any arguments.
C) be included in private inner classes.
D) implement an interface.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
11
To end an application, you pass this as the argument to the JFrame class's setDefaultCloseOperation method.
A) JFrame.CLOSE_NOT_HIDE
B) JFrame.END_ON_CLOSE
C) END_ON_CLOSE
D) JFrame.EXIT_ON_CLOSE
A) JFrame.CLOSE_NOT_HIDE
B) JFrame.END_ON_CLOSE
C) END_ON_CLOSE
D) JFrame.EXIT_ON_CLOSE
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
12
In GUI terminology, a container that can be displayed as a window is known as a
A) buffer.
B) message dialog.
C) Swing package.
D) frame.
A) buffer.
B) message dialog.
C) Swing package.
D) frame.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
13
If button1 references a JButton object, which of the following statements will make its background blue?
A) button1.makeBackground(Color.BLUE);
B) button1.setBackground(Color.BLUE);
C) button1.makeBackground(BLUE);
D) button1.set.Background(BLUE);
A) button1.makeBackground(Color.BLUE);
B) button1.setBackground(Color.BLUE);
C) button1.makeBackground(BLUE);
D) button1.set.Background(BLUE);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
14
When used as an exit code, this value traditionally indicates that the program ended successfully.
A) -1
B) null
C) 0
D) 1
A) -1
B) null
C) 0
D) 1
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
15
What will be displayed when the following statement is executed?
JOptionPane.showMessageDialog(null, "Java is fun!");
A) a message dialog box with "Java is fun!" on the OK button
B) a message dialog box with "Java is fun!" in the title bar
C) a message dialog box with "Java is fun!" in the message area
D) A message dialog box will be created in memory, but it will not be displayed.
JOptionPane.showMessageDialog(null, "Java is fun!");
A) a message dialog box with "Java is fun!" on the OK button
B) a message dialog box with "Java is fun!" in the title bar
C) a message dialog box with "Java is fun!" in the message area
D) A message dialog box will be created in memory, but it will not be displayed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
16
When an application is not performing correctly, programmers sometimes write statements that display ________ into the application.
A) JVM stack indicators
B) translated byte codes
C) diagnostic messages
D) analytic data output
A) JVM stack indicators
B) translated byte codes
C) diagnostic messages
D) analytic data output
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
17
When a component is added to a region in the BorderLayout manager,
A) the component is stretched so it fills up the entire region.
B) the component retains its original size.
C) the region is resized to fit the component.
D) the region and the component are resized to fit the frame.
A) the component is stretched so it fills up the entire region.
B) the component retains its original size.
C) the region is resized to fit the component.
D) the region and the component are resized to fit the frame.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
18
A modal dialog box
A) suspends execution of any other statements until the dialog box is closed.
B) is displayed for a short period of time and then disappears from the screen.
C) always appears in the center of the screen.
D) determines the mode your program runs in.
A) suspends execution of any other statements until the dialog box is closed.
B) is displayed for a short period of time and then disappears from the screen.
C) always appears in the center of the screen.
D) determines the mode your program runs in.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
19
When a class is instantiated ________, the class is created in memory, but its address is not assigned to any reference variable.
A) lightly
B) referentially
C) anonymously
D) dynamically
A) lightly
B) referentially
C) anonymously
D) dynamically
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
20
This layout manager arranges components in five regions.
A) GridLayout
B) FlowLayout
C) BorderLayout
D) RegionLayout
A) GridLayout
B) FlowLayout
C) BorderLayout
D) RegionLayout
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
21
A(n) ________ is an action that takes place within a program, such as the clicking of a button.
A) event
B) selection
C) incident
D) choice
A) event
B) selection
C) incident
D) choice
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
22
Programs that operate in a GUI environment must be event-driven.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
23
Which of the following is not a rule for the FlowLayout manager?
A) New components will be added in a row from left to right.
B) Multiple components can be added to a container that uses a FlowLayout manager.
C) When there is no more room in a row, additional components are put on the next row.
D) All of the above are rules for the FlowLayout manager.
A) New components will be added in a row from left to right.
B) Multiple components can be added to a container that uses a FlowLayout manager.
C) When there is no more room in a row, additional components are put on the next row.
D) All of the above are rules for the FlowLayout manager.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
24
Splash screens are particularly important for large applications that take a long time to load, because they assure the user that the program is not malfunctioning.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
25
Swing components are part of the javax.swing package.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
26
A GUI program automatically stops executing when the end of the main method is reached.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
27
The ActionListener interface is in this package.
A) java.awt.event
B) javax.swing.event
C) java.lang.event
D) java.action.event
A) java.awt.event
B) javax.swing.event
C) java.lang.event
D) java.action.event
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
28
A mutually exclusive relationship is created between radio buttons only when they are added to a ButtonGroup object.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
29
What is the default title for the input dialog box?
A) Message
B) Please Confirm
C) Select an Option
D) Input
A) Message
B) Please Confirm
C) Select an Option
D) Input
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
30
It is possible to write the main method directly into a GUI class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
31
This is a basic window that has a border around it, a title bar, and a set of buttons for minimizing, maximizing, and closing the window.
A) dialog box
B) container
C) pane
D) frame
A) dialog box
B) container
C) pane
D) frame
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
32
When using the BorderLayout manager, how many components can each region hold?
A) one
B) two
C) five
D) ten
A) one
B) two
C) five
D) ten
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
33
The process of connecting an event listener object to a component is called ________ the event listener.
A) coupling
B) priming
C) registering
D) installing
A) coupling
B) priming
C) registering
D) installing
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
34
Even if you write an event listener, it will not execute unless it has been registered with the correct component.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
35
This is a graphic image that is displayed while an application loads into memory and starts up.
A) loading icon
B) splash screen
C) screen saver
D) Java logo
A) loading icon
B) splash screen
C) screen saver
D) Java logo
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
36
The signature of the actionPerformed method in the ActionListener interface specifies that it accepts one argument, which is an ActionEvent object.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
37
By default, a window is hidden from view when the close button is clicked, but the application is not terminated.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
38
When this argument is passed to the JFrame class's setDefaultCloseOperation method, the application is hidden, but not closed.
A) JFrame.EXIT_ON_CLOSE
B) JFrame.HIDE_ON_CLOSE
C) JFrame.SUSPEND_ON_CLOSE
D) HIDE_ON_CLOSE
A) JFrame.EXIT_ON_CLOSE
B) JFrame.HIDE_ON_CLOSE
C) JFrame.SUSPEND_ON_CLOSE
D) HIDE_ON_CLOSE
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
39
What will be the result of executing the following statement?
Panel.setBorder(BorderFactory.createLineBorder(Color.BLUE, 5));
A) The JPanel referenced by panel will have a blue line border that is 5 characters thick.
B) The JPanel referenced by panel will have a blue line border that is 5 inches thick.
C) The JPanel referenced by panel will have a blue line border that is 5 pixels thick.
D) The JPanel referenced by panel will have a blue line border that is 5 millimeters thick.
Panel.setBorder(BorderFactory.createLineBorder(Color.BLUE, 5));
A) The JPanel referenced by panel will have a blue line border that is 5 characters thick.
B) The JPanel referenced by panel will have a blue line border that is 5 inches thick.
C) The JPanel referenced by panel will have a blue line border that is 5 pixels thick.
D) The JPanel referenced by panel will have a blue line border that is 5 millimeters thick.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
40
Because the System.out.println method sends its output to the console, diagnostic messages can be displayed without interfering with the application's GUI windows.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck