Deck 12: Advanced Guis and Graphics

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

A) check boxes
B) radio buttons
C) a combo box
D) a text area
سؤال
Given Graphics object g, what method call is used to draw a line from X = 10, Y = 20 to X = 80, Y = 40?

A) g.drawLine(10, 80, 20, 40);
B) g.drawLine(10, 20, 80, 40);
C) g.drawLine(10, 20, 40, 80);
D) g.drawLine((10, 20), (80, 40));
سؤال
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();
سؤال
How many inches is 12-point font?

A) 1/6
B) 1
C) 6
D) 72
سؤال
What class must be extended when you create an applet?

A) AWT
B) JDK
C) JApplet
D) Graphics
سؤال
A JComboBox generates an ItemEvent.
سؤال
JRadioButtons are useful when you want to give the user the ability to select more than one of the presented options.
سؤال
Applets are embedded in ____ documents.

A) HTTP
B) TCP
C) HTML
D) VRML
سؤال
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);
سؤال
What class can be used to generate a random number?

A) JApplet
B) Graphics
C) Math
D) RandomNumber
سؤال
The layout manager FlowLayout places components in the container from left to right and centered, by default, until no more items can be placed.
سؤال
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()
B) setTabsize()
C) setColumns()
D) setText()
سؤال
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()
B) paint()
C) paintApplet()
D) setApplet()
سؤال
Item events are handled by the interface ItemListener, which contains only the abstract method itemStateChanged.
سؤال
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);
سؤال
To draw a rectangle filled with the current color, you can use the method ____.

A) drawRect()
B) fillRect()
C) drawOval()
D) fillOval()
سؤال
Which of the following is NOT included in the Java applet in the accompanying figure?

A) Check box
B) Radio button
C) Combo box
D) List
سؤال
Which of the following mouse events is handled by the interface MouseMotionListener?

A) mouseExited
B) mouseReleased
C) mouseDragged
D) mousePressed
سؤال
Which of the following is the default layout manager for a Java application?

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

A) three
B) five
C) seven
D) nine
سؤال
When you press a meta key, the method ____ is executed.

A) metaKeyPressed
B) keyPressed
C) keyDown
D) keyTyped
سؤال
menuMB.add(fileMenu);
MenuMB.add(editMenu);
MenuMB.add(viewMenu);
MenuMB.add(insertMenu);Which menu will appear first if it is added to the menu bar in the order shown in the accompanying figure?

A) fileMenu
B) editMenu
C) viewMenu
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
B) FlowLayout
C) BorderLayout
D) EvenLayout
سؤال
When you type a regular alphanumeric key, the ____ method is executed.

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

A) check boxes
B) radio buttons
C) a combo box
D) a text area
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
24
Given Graphics object g, what method call is used to draw a line from X = 10, Y = 20 to X = 80, Y = 40?

A) g.drawLine(10, 80, 20, 40);
B) g.drawLine(10, 20, 80, 40);
C) g.drawLine(10, 20, 40, 80);
D) g.drawLine((10, 20), (80, 40));
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
25
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();
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
26
How many inches is 12-point font?

A) 1/6
B) 1
C) 6
D) 72
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
27
What class must be extended when you create an applet?

A) AWT
B) JDK
C) JApplet
D) Graphics
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
28
A JComboBox generates an ItemEvent.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
29
JRadioButtons are useful when you want to give the user the ability to select more than one of the presented options.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
30
Applets are embedded in ____ documents.

A) HTTP
B) TCP
C) HTML
D) VRML
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
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);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
32
What class can be used to generate a random number?

A) JApplet
B) Graphics
C) Math
D) RandomNumber
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
33
The layout manager FlowLayout places components in the container from left to right and centered, by default, until no more items can be placed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
34
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
35
Which of the following methods does the class JTextArea inherit from the class JTextComponent?

A) setLineWrap()
B) setTabsize()
C) setColumns()
D) setText()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
36
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);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
37
Which applet method is called by the Web browser to display the applet to the screen?

A) drawApplet()
B) paint()
C) paintApplet()
D) setApplet()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
38
Item events are handled by the interface ItemListener, which contains only the abstract method itemStateChanged.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
39
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);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
40
To draw a rectangle filled with the current color, you can use the method ____.

A) drawRect()
B) fillRect()
C) drawOval()
D) fillOval()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
41
Which of the following is NOT included in the Java applet in the accompanying figure?

A) Check box
B) Radio button
C) Combo box
D) List
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
42
Which of the following mouse events is handled by the interface MouseMotionListener?

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

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

A) three
B) five
C) seven
D) nine
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
45
When you press a meta key, the method ____ is executed.

A) metaKeyPressed
B) keyPressed
C) keyDown
D) keyTyped
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
46
menuMB.add(fileMenu);
MenuMB.add(editMenu);
MenuMB.add(viewMenu);
MenuMB.add(insertMenu);Which menu will appear first if it is added to the menu bar in the order shown in the accompanying figure?

A) fileMenu
B) editMenu
C) viewMenu
D) insertMenu
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
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
B) FlowLayout
C) BorderLayout
D) EvenLayout
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
48
When you type a regular alphanumeric key, the ____ method is executed.

A) keyPressed
B) keyTyped
C) keyDown
D) keyUp
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 48 في هذه المجموعة.