Deck 14: Applets and More

ملء الشاشة (f)
exit full mode
سؤال
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
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Which of the following sound file formats does Java not support?

A) .wav
B) .au
C) .mid
D) Java supports 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
سؤال
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.
سؤال
What does the tag < p > cause to happen?

A) A double space
B) A paragraph break
C) Indentation for a paragraph
D) Plain text to be displayed
سؤال
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.
سؤال
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)
سؤال
Which of the following is not a valid AWT class?

A) Panel
B) Applet
C) TextArea
D) JMenu
سؤال
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
سؤال
Hypertext can contain

A) a Java application program
B) exception methods
C) executable code
D) a link to another Web page
سؤال
Which tag will produce largest text?

A) < h4 >Hello< /h4 >
B) < h3 >Hello< /h3 >
C) < h2 >Hello< /h2 >
D) < h1 >Hello< /h1 >
سؤال
Certain restrictions are placed on applets.If an applet attempts to violate one of these 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.
سؤال
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) keep the doctor away.
سؤال
An applet using a Swing GUI extends which class?

A) Applet
B) JApplet
C) JSwing
D) JFrame
سؤال
Which of the following will load the applet,TestApplet?

A) < applet code="TestApplet.class" width=200 height=50 >< /applet >
B) < applet code=TestApplet.class width=200 height=50 >< /applet >
C) < load code="TestApplet.class" width=200 height=50 >< /load >
D) < load code=TestApplet.class width=200 height=50 >< /load >
سؤال
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
سؤال
What does the HTML tag < hr > 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.
سؤال
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
< a href="http://www.applications.com" >applications.< /a >

A) Click
B) here
C) Click here to learn more about
D) applications
سؤال
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
سؤال
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.
سؤال
Some browsers do not directly support the Swing classes of applets.
سؤال
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.
سؤال
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
سؤال
The Applet class requires that you write a constructor to create an object of the class.
سؤال
For all Swing components except JApplet and JFrame,you should override the paintComponent method instead of the paint method.
سؤال
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
سؤال
The delay parameter in the Timer constructor is the amount of time between action events,measured in milliseconds.
سؤال
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.
سؤال
Everything that appears between these tags in an HTML document is the content of the Web page.

A) < head > and < /head >
B) < html > and < /html >
C) < doc > and < /doc >
D) < content > and < /content >
سؤال
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
سؤال
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");
سؤال
An applet using a Swing GUI is extended from this class.

A) JFrame
B) JLabel
C) JSwing
D) JApplet
سؤال
If you want to make sure that an applet is compatible with all Java-enabled browsers,use Swing components instead of AWT.
سؤال
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)
سؤال
Whenever you need a component of any type to be painted,call the paint method.
سؤال
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
سؤال
The delay parameter in the Timer constructor is the amount of time between action events,measured in microseconds.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/39
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 14: Applets and More
1
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
A
2
Which of the following sound file formats does Java not support?

A) .wav
B) .au
C) .mid
D) Java supports all of the above
D
3
These are Java programs that are usually part of a Web site.

A) Applications
B) Applets
C) Classes
D) Web services
B
4
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
5
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
6
What does the tag < p > cause to happen?

A) A double space
B) A paragraph break
C) Indentation for a paragraph
D) Plain text to be displayed
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
7
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
8
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)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
9
Which of the following is not a valid AWT class?

A) Panel
B) Applet
C) TextArea
D) JMenu
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
10
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
11
Hypertext can contain

A) a Java application program
B) exception methods
C) executable code
D) a link to another Web page
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
12
Which tag will produce largest text?

A) < h4 >Hello< /h4 >
B) < h3 >Hello< /h3 >
C) < h2 >Hello< /h2 >
D) < h1 >Hello< /h1 >
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
13
Certain restrictions are placed on applets.If an applet attempts to violate one of these 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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
14
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) keep the doctor away.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
15
An applet using a Swing GUI extends which class?

A) Applet
B) JApplet
C) JSwing
D) JFrame
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
16
Which of the following will load the applet,TestApplet?

A) < applet code="TestApplet.class" width=200 height=50 >< /applet >
B) < applet code=TestApplet.class width=200 height=50 >< /applet >
C) < load code="TestApplet.class" width=200 height=50 >< /load >
D) < load code=TestApplet.class width=200 height=50 >< /load >
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
17
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
18
What does the HTML tag < hr > 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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
19
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
< a href="http://www.applications.com" >applications.< /a >

A) Click
B) here
C) Click here to learn more about
D) applications
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
20
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
21
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
22
Some browsers do not directly support the Swing classes of applets.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
23
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
24
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
25
The Applet class requires that you write a constructor to create an object of the class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
26
For all Swing components except JApplet and JFrame,you should override the paintComponent method instead of the paint method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
27
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
28
The delay parameter in the Timer constructor is the amount of time between action events,measured in milliseconds.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
29
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
30
The browser creates an instance of the applet class automatically.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
31
Everything that appears between these tags in an HTML document is the content of the Web page.

A) < head > and < /head >
B) < html > and < /html >
C) < doc > and < /doc >
D) < content > and < /content >
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
32
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
33
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");
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
34
An applet using a Swing GUI is extended from this class.

A) JFrame
B) JLabel
C) JSwing
D) JApplet
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
35
If you want to make sure that an applet is compatible with all Java-enabled browsers,use Swing components instead of AWT.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
36
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)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
37
Whenever you need a component of any type to be painted,call the paint method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
38
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
39
The delay parameter in the Timer constructor is the amount of time between action events,measured in microseconds.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.