Deck 12: Advanced Guis and Graphics

ملء الشاشة (f)
exit full mode
سؤال
The R in RGB stands for Right.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
You can create an applet by extending the class JFrame.
سؤال
Unlike application programs, when you compile a Java applet, no .class file is produced.
سؤال
The class Container is the superclass of all the classes designed to provide a GUI.
سؤال
You must import the package javax.swing in order to use the methods in the class Font.
سؤال
You can use the methods Background and Foreground to set the background and foreground colors of a component.
سؤال
Applets use the init method in place of constructors to initialize various GUI components and data members.
سؤال
Applets do not have titles.
سؤال
The paint method is used to get data from the user.
سؤال
The class Graphics provides methods for drawing items such as lines, ovals, and rectangles on the screen.
سؤال
An applet invokes the methods start, init, stop, paint, and destroy in sequence.
سؤال
The class JComponent is part of the package javax.swing.
سؤال
You can create instances of Color by mixing red, green, and blue hues in various proportions.
سؤال
JCheckBox is a subclass of the abstract class ToggleButton.
سؤال
JTextAreas can be used to display multiple lines of text.
سؤال
Like Java application programs, Java applets have the method main.
سؤال
A Java applet is the same as a Java GUI application program.
سؤال
You can close an applet by closing the HTML document in which the applet is embedded.
سؤال
The class Graphics is an abstract class.
سؤال
You cannot convert a GUI application into an applet.
سؤال
How many inches is 12-point font?

A) 1/6
C) 6
B) 1
D) 72
سؤال
Does an applet compile like any other Java application program?

A) No -- applets do not produce a .class file because they don't have a main method.
B) Yes -- except the Web browser compiles the applet code.
C) Yes -- it is compiled as an application program and produces a .class file.
D) No -- applets are .applet files and not .java files.
سؤال
Which of the following methods does the class JTextArea inherit from the class JTextComponent?

A) setLineWrap()
C) setColumns()
B) setTabsize()
D) setText()
سؤال
Given Graphics object graph, which statement can you use to change the pen color to red?

A) graph.setColor(Color.red);
B) graph.setPen(Color.red);
C) setForeground(red);
D) graph.getRed();
سؤال
If graph holds a Graphics object, which of the following puts "CAT" starting at X = 20, Y = 50?

A) drawString("CAT", 20, 50);
B) graph.drawString(20, 50, "CAT");
C) graph.println("CAT");
D) graph.drawString("CAT", 20, 50);
سؤال
Which applet method is called by the Web browser to display the applet to the screen?

A) drawApplet()
C) paintApplet()
B) paint()
D) setApplet()
سؤال
What class must be extended when you create an applet?

A) AWT
C) JApplet
B) JDK
D) Graphics
سؤال
Which of the following sets the background color of the applet to white?

A) setAppletColor(white);
B) setBackground(white);
C) setBackground(Color.white);
D) setAppletColor(white);
سؤال
What HTML tags begin and end a Web page?

A)
C)
B)
D)
سؤال
A JComboBox generates an ItemEvent.
سؤال
Which of the following constructors would produce the color white?

A) Color whiteColor = new Color(0, 0, 0);
B) Color whiteColor = new Color(255, 0, 0);
C) Color whiteColor = new Color(255, 255, 0);
D) Color whiteColor = new Color(255, 255, 255);
سؤال
The layout manager FlowLayout places components in the container from left to right and centered, by default, until no more items can be placed.
سؤال
To draw a rectangle filled with the current color, you can use the method ____.

A) drawRect()
C) drawOval()
B) fillRect()
D) fillOval()
سؤال
Clicking on a JCheckBox generates an item event.
سؤال
Given Graphics object graph, which of the following draws a circle with a radius of 50, at X = 20, Y = 30?

A) graph.drawCircle(50);
B) graph.drawCircle(50, 50, 20, 30);
C) graph.drawOval(50, 50);
D) graph.drawOval(20, 30, 50, 50);
سؤال
JRadioButtons are useful when you want to give the user the ability to select more than one of the presented options.
سؤال
Item events are handled by the interface ItemListener, which contains only the abstract method itemStateChanged.
سؤال
Which of the options in the accompanying figure is a correct Web page for the applet WelcomeHomeApplet?

A) A
C) C
B) B
D) D
سؤال
What class can be used to generate a random number?

A) JApplet
C) Math
B) Graphics
D) RandomNumber
سؤال
Applets are embedded in ____ documents.

A) HTTP
C) HTML
B) TCP
D) VRML
سؤال
The graphic in the accompanying figure is an example of ____.

A) check boxes
C) a combo box
B) radio buttons
D) a text area
سؤال
Which of the following mouse events is handled by the interface MouseMotionListener?

A) mouseExited
C) mouseDragged
B) mouseReleased
D) mousePressed
سؤال
When you press a meta key, the method ____ is executed.

A) metaKeyPressed
C) keyDown
B) keyPressed
D) keyTyped
سؤال
When you type a regular alphanumeric key, the ____ method is executed.

A) keyPressed
C) keyDown
B) keyTyped
D) keyUp
سؤال
Which of the following is NOT included in the Java applet in the accompanying figure?

A) Check box
C) Combo box
B) Radio button
D) List
سؤال
Which menu will appear first if it is added to the menu bar in the order shown in the accompanying figure?

A) fileMenu
C) viewMenu
B) editMenu
D) insertMenu
سؤال
In which of the following layout managers do all rows (columns) have the same number of components and all components have the same size?

A) GridLayout
C) BorderLayout
B) FlowLayout
D) EvenLayout
سؤال
Which of the following is the default layout manager for a Java application?

A) null
C) FlowLayout
B) GridLayout
D) BorderLayout
سؤال
A mouse can generate ____ different types of events.

A) three
C) seven
B) five
D) nine
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/49
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 12: Advanced Guis and Graphics
1
The R in RGB stands for Right.
False
2
You can create an applet by extending the class JFrame.
False
3
Unlike application programs, when you compile a Java applet, no .class file is produced.
False
4
The class Container is the superclass of all the classes designed to provide a GUI.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
5
You must import the package javax.swing in order to use the methods in the class Font.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
6
You can use the methods Background and Foreground to set the background and foreground colors of a component.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
7
Applets use the init method in place of constructors to initialize various GUI components and data members.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
8
Applets do not have titles.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
9
The paint method is used to get data from the user.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
10
The class Graphics provides methods for drawing items such as lines, ovals, and rectangles on the screen.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
11
An applet invokes the methods start, init, stop, paint, and destroy in sequence.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
12
The class JComponent is part of the package javax.swing.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
13
You can create instances of Color by mixing red, green, and blue hues in various proportions.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
14
JCheckBox is a subclass of the abstract class ToggleButton.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
15
JTextAreas can be used to display multiple lines of text.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
16
Like Java application programs, Java applets have the method main.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
17
A Java applet is the same as a Java GUI application program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
18
You can close an applet by closing the HTML document in which the applet is embedded.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
19
The class Graphics is an abstract class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
20
You cannot convert a GUI application into an applet.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
21
How many inches is 12-point font?

A) 1/6
C) 6
B) 1
D) 72
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
22
Does an applet compile like any other Java application program?

A) No -- applets do not produce a .class file because they don't have a main method.
B) Yes -- except the Web browser compiles the applet code.
C) Yes -- it is compiled as an application program and produces a .class file.
D) No -- applets are .applet files and not .java files.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
23
Which of the following methods does the class JTextArea inherit from the class JTextComponent?

A) setLineWrap()
C) setColumns()
B) setTabsize()
D) setText()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
24
Given Graphics object graph, which statement can you use to change the pen color to red?

A) graph.setColor(Color.red);
B) graph.setPen(Color.red);
C) setForeground(red);
D) graph.getRed();
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
25
If graph holds a Graphics object, which of the following puts "CAT" starting at X = 20, Y = 50?

A) drawString("CAT", 20, 50);
B) graph.drawString(20, 50, "CAT");
C) graph.println("CAT");
D) graph.drawString("CAT", 20, 50);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
26
Which applet method is called by the Web browser to display the applet to the screen?

A) drawApplet()
C) paintApplet()
B) paint()
D) setApplet()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
27
What class must be extended when you create an applet?

A) AWT
C) JApplet
B) JDK
D) Graphics
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
28
Which of the following sets the background color of the applet to white?

A) setAppletColor(white);
B) setBackground(white);
C) setBackground(Color.white);
D) setAppletColor(white);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
29
What HTML tags begin and end a Web page?

A)
C)
B)
D)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
30
A JComboBox generates an ItemEvent.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
31
Which of the following constructors would produce the color white?

A) Color whiteColor = new Color(0, 0, 0);
B) Color whiteColor = new Color(255, 0, 0);
C) Color whiteColor = new Color(255, 255, 0);
D) Color whiteColor = new Color(255, 255, 255);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
32
The layout manager FlowLayout places components in the container from left to right and centered, by default, until no more items can be placed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
33
To draw a rectangle filled with the current color, you can use the method ____.

A) drawRect()
C) drawOval()
B) fillRect()
D) fillOval()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
34
Clicking on a JCheckBox generates an item event.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
35
Given Graphics object graph, which of the following draws a circle with a radius of 50, at X = 20, Y = 30?

A) graph.drawCircle(50);
B) graph.drawCircle(50, 50, 20, 30);
C) graph.drawOval(50, 50);
D) graph.drawOval(20, 30, 50, 50);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
36
JRadioButtons are useful when you want to give the user the ability to select more than one of the presented options.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
37
Item events are handled by the interface ItemListener, which contains only the abstract method itemStateChanged.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
38
Which of the options in the accompanying figure is a correct Web page for the applet WelcomeHomeApplet?

A) A
C) C
B) B
D) D
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
39
What class can be used to generate a random number?

A) JApplet
C) Math
B) Graphics
D) RandomNumber
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
40
Applets are embedded in ____ documents.

A) HTTP
C) HTML
B) TCP
D) VRML
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
41
The graphic in the accompanying figure is an example of ____.

A) check boxes
C) a combo box
B) radio buttons
D) a text area
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
42
Which of the following mouse events is handled by the interface MouseMotionListener?

A) mouseExited
C) mouseDragged
B) mouseReleased
D) mousePressed
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
43
When you press a meta key, the method ____ is executed.

A) metaKeyPressed
C) keyDown
B) keyPressed
D) keyTyped
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
44
When you type a regular alphanumeric key, the ____ method is executed.

A) keyPressed
C) keyDown
B) keyTyped
D) keyUp
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
45
Which of the following is NOT included in the Java applet in the accompanying figure?

A) Check box
C) Combo box
B) Radio button
D) List
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
46
Which menu will appear first if it is added to the menu bar in the order shown in the accompanying figure?

A) fileMenu
C) viewMenu
B) editMenu
D) insertMenu
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
47
In which of the following layout managers do all rows (columns) have the same number of components and all components have the same size?

A) GridLayout
C) BorderLayout
B) FlowLayout
D) EvenLayout
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
48
Which of the following is the default layout manager for a Java application?

A) null
C) FlowLayout
B) GridLayout
D) BorderLayout
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
49
A mouse can generate ____ different types of events.

A) three
C) seven
B) five
D) nine
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.