Deck 14: Applets and More

ملء الشاشة (f)
exit full mode
سؤال
Applet restrictions are:

A) necessary to prevent malicious code from attacking or spying on unsuspecting users
B) determined by the Web browser
C) optional in Java 7
D) enabled only if the applet is running on a Web server
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
________ is the language that Web pages are written in.

A) PHP
B) XML
C) HTML
D) JavaScript
سؤال
In the link produced by the following HTML, what word would you click to go to the linked location?
Click here to learn more about
applications.

A) Click
B) here
C) Click here to learn more about
D) applications
سؤال
When the applet viewer opens an HTML document with more than one applet tag:

A) it terminates immediately
B) it displays the first applet, and then terminates
C) it displays each applet in a separate window
D) it displays each applet in order in the same window
سؤال
Look at the following applet code:
1 import javax.swing.*;
2 import java.awt.*;
3 public class GraphicsTest extends JApplet
4 {
5 public void init()
6 {
7 getContentPane().setBackground(Color.WHITE);
8 }
9 public void paint(Graphics g)
10 {
11 int[] xCoords = {20, 20, 60, 100, 140, 140, 100, 60};
12 int[] ycoords = {20, 100, 140, 140, 100, 60, 20, 20};
13 super.paint(g);
14 g.setColor(Color.YELLOW);
15 g.fillPolygon(xCoords, yCoords, 8);
16 g.setColor(color.BLACK);
17 g.setFont(new Font("SansSerif", Font.BOLD, 35));
18 g.drawString("SLOW", 35, 95);
19 }
20 }
What is the color of the polygon?

A) White
B) Yellow
C) Black
D) None of the above
سؤال
Which of the following will load the applet, TestApplet?

A)
B)
C)
D)
سؤال
Which of the following is NOT a valid AWT class?

A) Panel
B) Applet
C) TextArea
D) JMenu
سؤال
Which tag will produce largest text?

A)

Hello


B)

Hello


C)

Hello


D)

Hello

سؤال
What does the tag

cause to happen?


A) A double space
B) A paragraph break
C) Indentation for a paragraph
D) Plain text to be displayed
سؤال
When someone visits a Web page containing a Java applet:

A) the applet is executed on the server and displayed on the Web page
B) the applet is downloaded to the visitor's browser and executed
C) the applet is executed using a portion of the resources from each visitor's browser
D) the visitor's browser acts as the server and hosts the applet for other visitors
سؤال
An HTML document is usually saved with what file name extension?

A) )xml
B) )asp
C) )js
D) )html
سؤال
Look at the following applet code:
1 import javax.swing.*;
2 import java.awt.*;
3 public class GraphicsTest extends JApplet
4 {
5 public void init()
6 {
7 getContentPane().setBackground(Color.WHITE);
8 }
9 public void paint(Graphics g)
10 {
11 int[] xCoords = {20, 20, 60, 100, 140, 140, 100, 60};
12 int[] ycoords = {20, 100, 140, 140, 100, 60, 20, 20};
13 super.paint(g);
14 g.setColor(Color.YELLOW);
15 g.fillPolygon(xCoords, yCoords, 8);
16 g.setColor(color.BLACK);
17 g.setFont(new Font("SansSerif", Font.BOLD, 35));
18 g.drawString("SLOW", 35, 95);
19 }
20 }
How many vertices does the polygon have?

A) 5
B) 6
C) 7
D) 8
سؤال
In the following code, which line has an error?
1 public class TestApplet extends JApplet
2 {
3 public void init()
4 {
5 super.JApplet();
6 JLabel label = new JLabel("Test label");
7 setLayout(new FlowLayout());
8 add(label);
9 }
10 }

A) 1
B) 3
C) 5
D) There are no errors
سؤال
Look at the following applet code. 1 import javax.swing.*;
2 import java.awt.*;
3 public class GraphicsTest extends JApplet
4 {
5 public void init()
6 {
7 getContentPane().setBackground(Color.WHITE);
8 }
9 public void paint(Graphics g)
10 {
11 int[] xCoords = {20, 20, 60, 100, 140, 140, 100, 60};
12 int[] ycoords = {20, 100, 140, 140, 100, 60, 20, 20};
13 super.paint(g);
14 g.setColor(Color.YELLOW);
15 g.fillPolygon(xCoords, yCoords, 8);
16 g.setColor(color.BLACK);
17 g.setFont(new Font("SansSerif", Font.BOLD, 35));
18 g.drawString("SLOW", 35, 95);
19 }
20 }
What will be the coordinates of the third point of the polygon?

A) (60, 140)
B) (140, 60)
C) (100, 140)
D) (140, 100)
سؤال
An applet using a Swing GUI extends which class?

A) Applet
B) JApplet
C) JSwing
D) JFrame
سؤال
If a frame component is 200 pixels wide and 300 pixels high, the lower, left-hand corner has (X, Y) coordinates of:

A) (0, 299)
B) (0, 300)
C) (200, 0)
D) (0, 0)
سؤال
Applets are important because the can be used to:

A) extend the capabilities of a web page
B) process large data files
C) run other programs on the user's system
D) convert machine language into HTML
سؤال
In an HTML document, the tags:

A) instruct the Web browser how to format the text
B) instruct the Web browser where to place images
C) instruct the Web browser what to do when the user clicks on a link
D) all of the above
سؤال
Which of the following is NOT a restriction placed on applets?

A) Applets cannot create files on the user's system.
B) Applets cannot execute operating system procedures on the user's system.
C) Applets cannot display a window.
D) Applets cannot retrieve the user's identity.
سؤال
Due to security restrictions, applets cannot:

A) Delete files
B) Read the contents of files
C) Create files on the user's system
D) All of the above
سؤال
These are Java programs that are usually part of a Web site.

A) Applications
B) Applets
C) Classes
D) Web services
سؤال
A mouse motion listener class can respond to:

A) The mouse button is clicked on
B) The mouse cursor exits a component's screen space
C) The mouse moved
D) The mouse button is released
سؤال
If a frame component is 300 pixels wide and 200 pixels high, the upper, right-hand corner has (X, Y) coordinates of:

A) (0, 0)
B) (300, 0)
C) (200, 300)
D) (299, 0)
سؤال
What will happen if you use instead of in an HTML document?

A) The tag will be ignored.
B) The text inside the tag will be centered just the same.
C) The text inside the tag will be centered and appear in all uppercase letters.
D) An exception will be thrown.
سؤال
Look at the following applet code:
1 import javax.swing.*;
2 import java.awt.*;
3 public class GraphicsTest extends JApplet
4 {
5 public void init()
6 {
7 getContentPane().setBackground(Color.WHITE);
8 }
9 public void paint(Graphics g)
10 {
11 super.paint(g);
12 g.setColor(Color.YELLOW);
13 g.fillOval(100, 100, 50, 50);
14 g.setColor(Color.BLACK);
15 g.setFont(new Font("SansSerif", Font.BOLD, 35));
16 g.drawString("SLOW", 110, 110);
17 }
18 }
What shape will the oval have?

A) Oblong, width greater than height
B) Oblong, width less than height
C) Circle
D) Cannot tell
سؤال
An applet using a Swing GUI is extended from this class.

A) JFrame
B) JLabel
C) JSwing
D) JApplet
سؤال
What does the HTML tag
cause to happen?

A) A header routine is created.
B) A horizontal line will be displayed.
C) A default header reference will be linked to.
D) The window will be blanked out before the remainder of the text is displayed.
سؤال
To support the Swing classes in applets, some browsers require a ________, which is software that extends or enhances another program.

A) extension
B) plug-in
C) booster
D) widget
سؤال
Look at the following applet code:
1 import javax.swing.*;
2 import java.awt.*;
3 public class GraphicsTest extends JApplet
4 {
5 public void init()
6 {
7 getContentPane().setBackground(Color.WHITE);
8 }
9 public void paint(Graphics g)
10 {
11 super.paint(g);
12 g.setColor(Color.YELLOW);
13 g.fillOval(100, 100, 50, 50);
14 g.setColor(Color.BLACK);
15 g.setFont(new Font("SansSerif", Font.BOLD, 35));
16 g.drawString("SLOW", 110, 110);
17 }
18 }
Which line sets the color that will be used to draw "SLOW"?

A) 7
B) 12
C) 14
D) 16
سؤال
Which of the following can a mouse listener respond to?

A) The mouse button is pressed.
B) The mouse button is clicked.
C) The mouse cursor enters a component's screen space.
D) All of the above
سؤال
When you extend an interface, you must implement all the methods defined in the interface. If you are interested in only one or two mouse events, you can extend the ________ class which implements the MouseListener interface, but does not require you to write all the functions in the interface.

A) MouseAdapter
B) MouseExtender
C) MouseMotionAdapter
D) MouseMotionExtender
سؤال
In an applet, events are handled:

A) with special applet event listeners
B) differently, depending upon which computer is running the applet
C) with event listeners, exactly as they are in GUI applications
D) by always terminating the applet
سؤال
If an applet attempts to violate one of the JVM restrictions:

A) the program has a fatal error.
B) it will display a window stating that it has violated the restriction.
C) an exception is thrown.
D) it automatically notifies the Web server of the violation.
سؤال
Given the following code, how many times per second will the TimerListener event be generated?
Timer timer = new Timer(1000, new TimerListener());

A) 1
B) 10
C) 100
D) 1000
سؤال
Which of the following sound file formats does Java not support?

A) )wav
B) )au
C) )mid
D) Java supports all of the above.
سؤال
One way of viewing the results of the applet which is invoked in the HTML document TestApplet.html is to enter the following at the command prompt.

A) appletviewer TestApplet.html
B) appleviewer TestApplet
C) viewapplet TestApplet.html
D) view TestApplet
سؤال
In the following code that uses a Swing GUI, which line has an error?
1 public class TestApplet extends Applet
2 {
3 public void init()
4 {
5 JLabel label = new JLabel("Test label");
6 setLayout(new FlowLayout());
7 add(label);
8 }
9 }

A) 1
B) 3
C) 5
D) There are no errors.
سؤال
Look at the following applet code:
1 import javax.swing.*;
2 import java.awt.*;
3 public class GraphicsTest extends JApplet
4 {
5 public void init()
6 {
7 getContentPane().setBackground(Color.WHITE);
8 }
9 public void paint(Graphics g)
10 {
11 super.paint(g);
12 g.setColor(Color.YELLOW);
13 g.fillOval(100, 100, 50, 50);
14 g.setColor(Color.BLACK);
15 g.setFont(new Font("SansSerif", Font.BOLD, 35));
16 g.drawString("SLOW", 110, 110);
17 }
18 }
What will be the coordinates of the center of the oval?

A) (100, 100)
B) (50, 50)
C) (100, 50)
D) (125, 125)
سؤال
The ________ object is responsible for drawing the entire applet window.

A) Graphics
B) Applet
C) SuperClass
D) JFrame
سؤال
Hypertext can contain:

A) a Java application program
B) exception methods
C) executable code
D) a link to another Web page
سؤال
For all Swing components EXCEPT JApplet and JFrame, you should override the paintComponent method instead of the paint method.
سؤال
Whenever you need a component of any type to be painted, call the paint method.
سؤال
Some browsers do not directly support the Swing classes of applets.
سؤال
Given the following code, how many times per second will the TimerListener event be generated?
Timer timer = new Timer(500, new TimerListener());

A) 5
B) 50
C) 2
D) 500
سؤال
The browser creates an instance of the applet class automatically.
سؤال
The delay parameter in the Timer constructor is the amount of time between action events, measured in microseconds.
سؤال
An applet does not have to be on a Web server in order to be executed.
سؤال
In the following code, what does getDocumentBase()return?
Play(getDocumentBase(), "mysound.wav");

A) A URL object containing the location of the applet's .class file
B) A URL object containing the location of the HTML file that invoked the applet
C) The HTML location "mysound.wav"
D) The sound file itself
سؤال
HTML describes the content and layout of a Web page, and creates links to other files and Web pages, but does not have sophisticated abilities such as performing math calculations and interacting with the user.
سؤال
The following getAudioClip() method returns an object that will load the sound file and assign the location of that file to clip which can then be used to call methods that may play the sound file one or more times:
Audioclip clip = getAudioClip(getDocumentBase(), "mysound.wav");
سؤال
The delay parameter in the Timer constructor is the amount of time between action events, measured in milliseconds.
سؤال
The play method will load and play a sound file once, then release it for garbage collection. The getAudioClip method will load the sound file and may assign the location of the sound file to a variable so it may be invoked many times.
سؤال
If you want to make sure that an applet is compatible with all Java-enabled browsers, use Swing components instead of AWT.
سؤال
The Applet class requires that you write a constructor to create an object of the class.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/54
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 14: Applets and More
1
Applet restrictions are:

A) necessary to prevent malicious code from attacking or spying on unsuspecting users
B) determined by the Web browser
C) optional in Java 7
D) enabled only if the applet is running on a Web server
A
2
________ is the language that Web pages are written in.

A) PHP
B) XML
C) HTML
D) JavaScript
C
3
In the link produced by the following HTML, what word would you click to go to the linked location?
Click here to learn more about
applications.

A) Click
B) here
C) Click here to learn more about
D) applications
D
4
When the applet viewer opens an HTML document with more than one applet tag:

A) it terminates immediately
B) it displays the first applet, and then terminates
C) it displays each applet in a separate window
D) it displays each applet in order in the same window
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
5
Look at the following applet code:
1 import javax.swing.*;
2 import java.awt.*;
3 public class GraphicsTest extends JApplet
4 {
5 public void init()
6 {
7 getContentPane().setBackground(Color.WHITE);
8 }
9 public void paint(Graphics g)
10 {
11 int[] xCoords = {20, 20, 60, 100, 140, 140, 100, 60};
12 int[] ycoords = {20, 100, 140, 140, 100, 60, 20, 20};
13 super.paint(g);
14 g.setColor(Color.YELLOW);
15 g.fillPolygon(xCoords, yCoords, 8);
16 g.setColor(color.BLACK);
17 g.setFont(new Font("SansSerif", Font.BOLD, 35));
18 g.drawString("SLOW", 35, 95);
19 }
20 }
What is the color of the polygon?

A) White
B) Yellow
C) Black
D) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
6
Which of the following will load the applet, TestApplet?

A)
B)
C)
D)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
7
Which of the following is NOT a valid AWT class?

A) Panel
B) Applet
C) TextArea
D) JMenu
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
8
Which tag will produce largest text?

A)

Hello


B)

Hello


C)

Hello


D)

Hello

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
9
What does the tag

cause to happen?


A) A double space
B) A paragraph break
C) Indentation for a paragraph
D) Plain text to be displayed
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
10
When someone visits a Web page containing a Java applet:

A) the applet is executed on the server and displayed on the Web page
B) the applet is downloaded to the visitor's browser and executed
C) the applet is executed using a portion of the resources from each visitor's browser
D) the visitor's browser acts as the server and hosts the applet for other visitors
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
11
An HTML document is usually saved with what file name extension?

A) )xml
B) )asp
C) )js
D) )html
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
12
Look at the following applet code:
1 import javax.swing.*;
2 import java.awt.*;
3 public class GraphicsTest extends JApplet
4 {
5 public void init()
6 {
7 getContentPane().setBackground(Color.WHITE);
8 }
9 public void paint(Graphics g)
10 {
11 int[] xCoords = {20, 20, 60, 100, 140, 140, 100, 60};
12 int[] ycoords = {20, 100, 140, 140, 100, 60, 20, 20};
13 super.paint(g);
14 g.setColor(Color.YELLOW);
15 g.fillPolygon(xCoords, yCoords, 8);
16 g.setColor(color.BLACK);
17 g.setFont(new Font("SansSerif", Font.BOLD, 35));
18 g.drawString("SLOW", 35, 95);
19 }
20 }
How many vertices does the polygon have?

A) 5
B) 6
C) 7
D) 8
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
13
In the following code, which line has an error?
1 public class TestApplet extends JApplet
2 {
3 public void init()
4 {
5 super.JApplet();
6 JLabel label = new JLabel("Test label");
7 setLayout(new FlowLayout());
8 add(label);
9 }
10 }

A) 1
B) 3
C) 5
D) There are no errors
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
14
Look at the following applet code. 1 import javax.swing.*;
2 import java.awt.*;
3 public class GraphicsTest extends JApplet
4 {
5 public void init()
6 {
7 getContentPane().setBackground(Color.WHITE);
8 }
9 public void paint(Graphics g)
10 {
11 int[] xCoords = {20, 20, 60, 100, 140, 140, 100, 60};
12 int[] ycoords = {20, 100, 140, 140, 100, 60, 20, 20};
13 super.paint(g);
14 g.setColor(Color.YELLOW);
15 g.fillPolygon(xCoords, yCoords, 8);
16 g.setColor(color.BLACK);
17 g.setFont(new Font("SansSerif", Font.BOLD, 35));
18 g.drawString("SLOW", 35, 95);
19 }
20 }
What will be the coordinates of the third point of the polygon?

A) (60, 140)
B) (140, 60)
C) (100, 140)
D) (140, 100)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
15
An applet using a Swing GUI extends which class?

A) Applet
B) JApplet
C) JSwing
D) JFrame
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
16
If a frame component is 200 pixels wide and 300 pixels high, the lower, left-hand corner has (X, Y) coordinates of:

A) (0, 299)
B) (0, 300)
C) (200, 0)
D) (0, 0)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
17
Applets are important because the can be used to:

A) extend the capabilities of a web page
B) process large data files
C) run other programs on the user's system
D) convert machine language into HTML
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
18
In an HTML document, the tags:

A) instruct the Web browser how to format the text
B) instruct the Web browser where to place images
C) instruct the Web browser what to do when the user clicks on a link
D) all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
19
Which of the following is NOT a restriction placed on applets?

A) Applets cannot create files on the user's system.
B) Applets cannot execute operating system procedures on the user's system.
C) Applets cannot display a window.
D) Applets cannot retrieve the user's identity.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
20
Due to security restrictions, applets cannot:

A) Delete files
B) Read the contents of files
C) Create files on the user's system
D) All of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
21
These are Java programs that are usually part of a Web site.

A) Applications
B) Applets
C) Classes
D) Web services
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
22
A mouse motion listener class can respond to:

A) The mouse button is clicked on
B) The mouse cursor exits a component's screen space
C) The mouse moved
D) The mouse button is released
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
23
If a frame component is 300 pixels wide and 200 pixels high, the upper, right-hand corner has (X, Y) coordinates of:

A) (0, 0)
B) (300, 0)
C) (200, 300)
D) (299, 0)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
24
What will happen if you use instead of in an HTML document?

A) The tag will be ignored.
B) The text inside the tag will be centered just the same.
C) The text inside the tag will be centered and appear in all uppercase letters.
D) An exception will be thrown.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
25
Look at the following applet code:
1 import javax.swing.*;
2 import java.awt.*;
3 public class GraphicsTest extends JApplet
4 {
5 public void init()
6 {
7 getContentPane().setBackground(Color.WHITE);
8 }
9 public void paint(Graphics g)
10 {
11 super.paint(g);
12 g.setColor(Color.YELLOW);
13 g.fillOval(100, 100, 50, 50);
14 g.setColor(Color.BLACK);
15 g.setFont(new Font("SansSerif", Font.BOLD, 35));
16 g.drawString("SLOW", 110, 110);
17 }
18 }
What shape will the oval have?

A) Oblong, width greater than height
B) Oblong, width less than height
C) Circle
D) Cannot tell
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
26
An applet using a Swing GUI is extended from this class.

A) JFrame
B) JLabel
C) JSwing
D) JApplet
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
27
What does the HTML tag
cause to happen?

A) A header routine is created.
B) A horizontal line will be displayed.
C) A default header reference will be linked to.
D) The window will be blanked out before the remainder of the text is displayed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
28
To support the Swing classes in applets, some browsers require a ________, which is software that extends or enhances another program.

A) extension
B) plug-in
C) booster
D) widget
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
29
Look at the following applet code:
1 import javax.swing.*;
2 import java.awt.*;
3 public class GraphicsTest extends JApplet
4 {
5 public void init()
6 {
7 getContentPane().setBackground(Color.WHITE);
8 }
9 public void paint(Graphics g)
10 {
11 super.paint(g);
12 g.setColor(Color.YELLOW);
13 g.fillOval(100, 100, 50, 50);
14 g.setColor(Color.BLACK);
15 g.setFont(new Font("SansSerif", Font.BOLD, 35));
16 g.drawString("SLOW", 110, 110);
17 }
18 }
Which line sets the color that will be used to draw "SLOW"?

A) 7
B) 12
C) 14
D) 16
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
30
Which of the following can a mouse listener respond to?

A) The mouse button is pressed.
B) The mouse button is clicked.
C) The mouse cursor enters a component's screen space.
D) All of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
31
When you extend an interface, you must implement all the methods defined in the interface. If you are interested in only one or two mouse events, you can extend the ________ class which implements the MouseListener interface, but does not require you to write all the functions in the interface.

A) MouseAdapter
B) MouseExtender
C) MouseMotionAdapter
D) MouseMotionExtender
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
32
In an applet, events are handled:

A) with special applet event listeners
B) differently, depending upon which computer is running the applet
C) with event listeners, exactly as they are in GUI applications
D) by always terminating the applet
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
33
If an applet attempts to violate one of the JVM restrictions:

A) the program has a fatal error.
B) it will display a window stating that it has violated the restriction.
C) an exception is thrown.
D) it automatically notifies the Web server of the violation.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
34
Given the following code, how many times per second will the TimerListener event be generated?
Timer timer = new Timer(1000, new TimerListener());

A) 1
B) 10
C) 100
D) 1000
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
35
Which of the following sound file formats does Java not support?

A) )wav
B) )au
C) )mid
D) Java supports all of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
36
One way of viewing the results of the applet which is invoked in the HTML document TestApplet.html is to enter the following at the command prompt.

A) appletviewer TestApplet.html
B) appleviewer TestApplet
C) viewapplet TestApplet.html
D) view TestApplet
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
37
In the following code that uses a Swing GUI, which line has an error?
1 public class TestApplet extends Applet
2 {
3 public void init()
4 {
5 JLabel label = new JLabel("Test label");
6 setLayout(new FlowLayout());
7 add(label);
8 }
9 }

A) 1
B) 3
C) 5
D) There are no errors.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
38
Look at the following applet code:
1 import javax.swing.*;
2 import java.awt.*;
3 public class GraphicsTest extends JApplet
4 {
5 public void init()
6 {
7 getContentPane().setBackground(Color.WHITE);
8 }
9 public void paint(Graphics g)
10 {
11 super.paint(g);
12 g.setColor(Color.YELLOW);
13 g.fillOval(100, 100, 50, 50);
14 g.setColor(Color.BLACK);
15 g.setFont(new Font("SansSerif", Font.BOLD, 35));
16 g.drawString("SLOW", 110, 110);
17 }
18 }
What will be the coordinates of the center of the oval?

A) (100, 100)
B) (50, 50)
C) (100, 50)
D) (125, 125)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
39
The ________ object is responsible for drawing the entire applet window.

A) Graphics
B) Applet
C) SuperClass
D) JFrame
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
40
Hypertext can contain:

A) a Java application program
B) exception methods
C) executable code
D) a link to another Web page
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
41
For all Swing components EXCEPT JApplet and JFrame, you should override the paintComponent method instead of the paint method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
42
Whenever you need a component of any type to be painted, call the paint method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
43
Some browsers do not directly support the Swing classes of applets.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
44
Given the following code, how many times per second will the TimerListener event be generated?
Timer timer = new Timer(500, new TimerListener());

A) 5
B) 50
C) 2
D) 500
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
45
The browser creates an instance of the applet class automatically.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
46
The delay parameter in the Timer constructor is the amount of time between action events, measured in microseconds.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
47
An applet does not have to be on a Web server in order to be executed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
48
In the following code, what does getDocumentBase()return?
Play(getDocumentBase(), "mysound.wav");

A) A URL object containing the location of the applet's .class file
B) A URL object containing the location of the HTML file that invoked the applet
C) The HTML location "mysound.wav"
D) The sound file itself
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
49
HTML describes the content and layout of a Web page, and creates links to other files and Web pages, but does not have sophisticated abilities such as performing math calculations and interacting with the user.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
50
The following getAudioClip() method returns an object that will load the sound file and assign the location of that file to clip which can then be used to call methods that may play the sound file one or more times:
Audioclip clip = getAudioClip(getDocumentBase(), "mysound.wav");
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
51
The delay parameter in the Timer constructor is the amount of time between action events, measured in milliseconds.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
52
The play method will load and play a sound file once, then release it for garbage collection. The getAudioClip method will load the sound file and may assign the location of the sound file to a variable so it may be invoked many times.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
53
If you want to make sure that an applet is compatible with all Java-enabled browsers, use Swing components instead of AWT.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
54
The Applet class requires that you write a constructor to create an object of the class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.