Deck 17: Applets, Images, and Sound

ملء الشاشة (f)
exit full mode
سؤال
The ____ command is part of the Java Development Kit (JDK), which provides a convenient environment in which to test your applets.

A) appletview
B) appletviewer
C) viewapplet
D) av
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
The name of a called applet must be a compiled Java applet with a .class file extension.
سؤال
The GIF image format is more flexible than other formats and uses lossless data compression.
سؤال
Because applets execute in a browser, the JApplet class contains methods that are automatically called by the browser.
سؤال
If the JApplet class was not already written, you would have to write more than ____ methods to give your JApplet all the capabilities of the built-in JApplet class.

A) 20
B) 50
C) 200
D) 300
سؤال
The applet can be run within a page on the Internet or an intranet, but you do not have to connect to the Internet to run an applet in your browser-you can simply use the browser locally.
سؤال
What package contains the JApplet class?

A) javax.applet
B) javax.swing
C) java.applet
D) java.swing
سؤال
You save applets with a(n) ____ file extension.

A).java
B).appl
C).applet
D).class
سؤال
Applet code runs in a constrained area called a(n) ____.

A) sandbox
B) toolbox
C) appletview
D) XHTML
سؤال
What is the parent class of JApplet?

A) Container
B) Component
C) Applet
D) Panel
سؤال
____ contains many commands that allow you to format text on a Web page, import graphic images, and link your page to other Web pages.

A) JApplet
B) HTML
C) Swing
D) Applet
سؤال
There are four methods inherited from JApplet that make up the life cycle of an applet.
سؤال
Applets can delete, read, or create files on the user's system.
سؤال
It is common practice for programmers to write their own stop() and destroy() methods.
سؤال
You can run an applet in a ____.

A) main() method
B) Java application
C) Web server
D) Web browser
سؤال
To compile an applet into bytecode, use the ____ command.

A) appletview
B) viewapp
C) javac
D) java
سؤال
You can use an overloaded version of the Image class method drawImage() to output a scaled image.
سؤال
In the JApplet life cycle, a paint() method would always be called before the init() and start() methods.
سؤال
You do not use the java command to execute an applet.
سؤال
The extension of an HTML document should be .html or ____.

A).htm
B).app
C).java
D).class
سؤال
A(n) ___________________ is a likeness of a person or thing.
سؤال
The ____ provides image-manipulation capabilities.

A) Java Speech API
B) Java Media Framework (JMF)
C) Java 3D API
D) Java Advanced Imaging API
سؤال
Which of the following lines of code are used when creating a JApplet using only the init() method?

A) public add.init()
B) public void init()
C) public void start()
D) public new init()
سؤال
If you want to place an image on a button, it is simplest to use the ____ class.

A) Image
B) ImageIcon
C) Sound
D) Graphics
سؤال
By calling ____ in an applet, you get a URL object that represents the folder in which the applet's class file is stored.

A) getFile()
B) getClass()
C) getDocBase()
D) getCodeBase()
سؤال
A(n) ___________________ is a program that is called within another application-often a Web browser.
سؤال
Use the ____ applet method to perform initialization tasks, such as setting variables to initial values or placing applet components on the screen.

A) initialize()
B) begin()
C) init()
D) start()
سؤال
The ___________________ method is always called after the init() and start() methods execute.
سؤال
The ____ method is used to load an Image into the named Image in the applet.

A) get()
B) loadImage()
C) load()
D) getImage()
سؤال
The ____ API allows you to add audio and video media to an application.

A) Java Media Framework (JMF)
B) Java Advanced Imaging
C) Java Speech
D) Java 2D or the Java 3D
سؤال
Which of the following statements will properly code the init() method header?

A) import void init()
B) JApplet void init()
C) JLabel = new init()
D) public void init()
سؤال
The tag that begins every HTML document is ____.

A)
B)
C)
D)
سؤال
You override the existing empty ____ method only if you want to take some action when a JApplet is no longer visible.

A) hide()
B) onHide()
C) destroy()
D) stop()
سؤال
Usually, you place three attributes within the tag: code, width, and ____.

A) codebase
B) size
C) length
D) height
سؤال
Invoking the ____ method after adding one or more JComponents to an applet ensures that the Components draw themselves on the screen.

A) draw()
B) paint()
C) repaint()
D) validate()
سؤال
When you write your own ____ method, you must include any actions you want your JApplet to take when a user revisits the JApplet.

A) repaint()
B) start()
C) paint()
D) restart()
سؤال
To run an applet from an HTML document, you add an and ___________________ tag pair.
سؤال
___________________ is a Swing class from which you can inherit to create your own applet.
سؤال
Which of the following cannot be performed with JApplets?

A) Use layout managers.
B) Add images and sounds.
C) Use a flow() method for layout.
D) Change label fonts/colors.
سؤال
With an applet, the browser can call ____ different methods automatically at different times.

A) two
B) three
C) four
D) five
سؤال
What are the four steps involved in creating an applet?
سؤال
What are the three object tag attributes commonly used to run an applet?
سؤال
How do you view an applet?
سؤال
How is an applet like a Java application?
سؤال
Match each term with the correct statement below.
a.current version of HTML
f.tags
b.init()
g.multimedia
c.start()
h.applet
d.HTML
i.play()
e.Applet Viewer
Executes again every time the applet becomes active after it has been inactive
سؤال
Explain lossless data compression and the image formats with which it is used.
سؤال
Match each term with the correct statement below.
a.current version of HTML
f.tags
b.init()
g.multimedia
c.start()
h.applet
d.HTML
i.play()
e.Applet Viewer
Describes the use of sound, images, graphics, and video in computer programs
سؤال
Match each term with the correct statement below.
a.current version of HTML
f.tags
b.init()
g.multimedia
c.start()
h.applet
d.HTML
i.play()
e.Applet Viewer
Retrieves and plays the sound as soon as possible after it is called
سؤال
Briefly describe the image formats that Java supports.
سؤال
How is an applet different from a Java application?
سؤال
Match each term with the correct statement below.
a.current version of HTML
f.tags
b.init()
g.multimedia
c.start()
h.applet
d.HTML
i.play()
e.Applet Viewer
Provides a convenient environment in which to test your applets
سؤال
Match each term with the correct statement below.
a.current version of HTML
f.tags
b.init()
g.multimedia
c.start()
h.applet
d.HTML
i.play()
e.Applet Viewer
Surrounded by angle brackets
سؤال
What are the two forms of the play() method?
سؤال
Match each term with the correct statement below.
a.current version of HTML
f.tags
b.init()
g.multimedia
c.start()
h.applet
d.HTML
i.play()
e.Applet Viewer
A simple language used to create Web pages for the Internet
سؤال
Match each term with the correct statement below.
a.current version of HTML
f.tags
b.init()
g.multimedia
c.start()
h.applet
d.HTML
i.play()
e.Applet Viewer
The first method called in any applet
سؤال
Describe the two methods for running an applet.
سؤال
Describe the stop() method.
سؤال
What are the methods of the applet life cycle?
سؤال
Match each term with the correct statement below.
a.current version of HTML
f.tags
b.init()
g.multimedia
c.start()
h.applet
d.HTML
i.play()
e.Applet Viewer
A little application
سؤال
Match each term with the correct statement below.
a.current version of HTML
f.tags
b.init()
g.multimedia
c.start()
h.applet
d.HTML
i.play()
e.Applet Viewer
Extensible Hypertext Markup Language
سؤال
Write the statement to retrieve and play the myTune.au sound file that will be stored in the same place as the applet.
سؤال
There are three attributes typically placed within the tag: code, width, and height. Describe the purpose of the three object tag attributes and their corresponding arguments.
سؤال
public void actionPerformed(ActionEvent e)
{
String name = answer.getText();
con.remove(greeting);
con.remove(pressMe);
con.remove(answer);
personalGreeting.setText("Hello, " + name + "! ");
con.add(personalGreeting);
con.setBackground(Color.PINK);
validate();
}
In the actionPerformed() method above, the final statement following the addition of the JLabel is validate(). Explain the validate() method and how it is used with JComponents.
سؤال
In order to play sounds more than once, or to stop and start sounds, the sound must be loaded into an AudioClip object. Write the statement to load the AudioClip named myClip with the sound file myTune.au, which is located in the audio folder.
سؤال

Using the above statement, identify the three object tag attributes and their corresponding arguments.
سؤال

____________________


Using the HTML code above, write the statement to run a JApplet named JHello. The applet will be 450 pixels wide by 150 pixels tall.
سؤال
import java.awt.*;
import java.applet.*;
import javax.swing.*;
public class JSound extends JApplet
{
AudioClip sound;
public void init()
{
sound = getAudioClip(getCodeBase(),"mysteryTune.au");
}
public void start()
{
___________________________________
}
public void stop()
{
___________________________________
}
public void paint(Graphics g)
{
super.paint(g);
Graphics2D g2D = (Graphics2D)g;
g2D.drawString("Listen to the mystery tune ", 10, 10);
}
}
In the first shaded line provided, write the loop() method to play the mysteryTune.au sound continually. On the second shaded line, write the stop() method to halt the mysteryTune.au sound file.
سؤال
import javax.swing.*;
import java.awt.*;
public class JHello extends JApplet
{
JLabel greeting = new JLabel("Hello. Who are you?");
public void init()
{
add(greeting);
}
}
The above code displays an applet with a JLabel added without a specified BorderLayout region. Describe how the JLabel will occupy the JApplet surface.
سؤال
arrowPicture.paintIcon(this, g, 150, 0);
The statement above is used to display the arrowPicture ImageIcon using the paintIcon() method. Describe the four arguments that are used in this method.
سؤال
import java.awt.*;
import java.applet.*;
import javax.swing.*;
public class JCompanyImage extends JApplet
{
Image companyLogo;
final int WIDTH = 287;
final int HEIGHT = 129;
final int FACTOR = 2;
public void init()
{
companyLogo = getImage(getCodeBase(), "CompanyLogo. png");
}
public void paint(Graphics g)
{
super.paint(g);
// Draw image at its natural size
___________________________________
// Draw the image scaled - twice as large
___________________________________
}
}
Using the above code, complete the first shaded line with the statement to draw the image first in its original size in the upper-left corner. In the second shaded line, write the code to redraw the image at twice its original size using the WIDTH, HEIGHT, and FACTOR values.
سؤال
The init() method is the first method called in any applet. Write the code for the init() method header and explain the purpose of the init() method.
سؤال

____________________________


In the blank line provided, write the code to run a JApplet named JGreeting that will be 370 pixels wide by 110 pixels tall.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/72
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 17: Applets, Images, and Sound
1
The ____ command is part of the Java Development Kit (JDK), which provides a convenient environment in which to test your applets.

A) appletview
B) appletviewer
C) viewapplet
D) av
B
2
The name of a called applet must be a compiled Java applet with a .class file extension.
True
3
The GIF image format is more flexible than other formats and uses lossless data compression.
False
4
Because applets execute in a browser, the JApplet class contains methods that are automatically called by the browser.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
5
If the JApplet class was not already written, you would have to write more than ____ methods to give your JApplet all the capabilities of the built-in JApplet class.

A) 20
B) 50
C) 200
D) 300
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
6
The applet can be run within a page on the Internet or an intranet, but you do not have to connect to the Internet to run an applet in your browser-you can simply use the browser locally.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
7
What package contains the JApplet class?

A) javax.applet
B) javax.swing
C) java.applet
D) java.swing
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
8
You save applets with a(n) ____ file extension.

A).java
B).appl
C).applet
D).class
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
9
Applet code runs in a constrained area called a(n) ____.

A) sandbox
B) toolbox
C) appletview
D) XHTML
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
10
What is the parent class of JApplet?

A) Container
B) Component
C) Applet
D) Panel
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
11
____ contains many commands that allow you to format text on a Web page, import graphic images, and link your page to other Web pages.

A) JApplet
B) HTML
C) Swing
D) Applet
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
12
There are four methods inherited from JApplet that make up the life cycle of an applet.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
13
Applets can delete, read, or create files on the user's system.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
14
It is common practice for programmers to write their own stop() and destroy() methods.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
15
You can run an applet in a ____.

A) main() method
B) Java application
C) Web server
D) Web browser
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
16
To compile an applet into bytecode, use the ____ command.

A) appletview
B) viewapp
C) javac
D) java
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
17
You can use an overloaded version of the Image class method drawImage() to output a scaled image.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
18
In the JApplet life cycle, a paint() method would always be called before the init() and start() methods.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
19
You do not use the java command to execute an applet.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
20
The extension of an HTML document should be .html or ____.

A).htm
B).app
C).java
D).class
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
21
A(n) ___________________ is a likeness of a person or thing.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
22
The ____ provides image-manipulation capabilities.

A) Java Speech API
B) Java Media Framework (JMF)
C) Java 3D API
D) Java Advanced Imaging API
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
23
Which of the following lines of code are used when creating a JApplet using only the init() method?

A) public add.init()
B) public void init()
C) public void start()
D) public new init()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
24
If you want to place an image on a button, it is simplest to use the ____ class.

A) Image
B) ImageIcon
C) Sound
D) Graphics
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
25
By calling ____ in an applet, you get a URL object that represents the folder in which the applet's class file is stored.

A) getFile()
B) getClass()
C) getDocBase()
D) getCodeBase()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
26
A(n) ___________________ is a program that is called within another application-often a Web browser.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
27
Use the ____ applet method to perform initialization tasks, such as setting variables to initial values or placing applet components on the screen.

A) initialize()
B) begin()
C) init()
D) start()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
28
The ___________________ method is always called after the init() and start() methods execute.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
29
The ____ method is used to load an Image into the named Image in the applet.

A) get()
B) loadImage()
C) load()
D) getImage()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
30
The ____ API allows you to add audio and video media to an application.

A) Java Media Framework (JMF)
B) Java Advanced Imaging
C) Java Speech
D) Java 2D or the Java 3D
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
31
Which of the following statements will properly code the init() method header?

A) import void init()
B) JApplet void init()
C) JLabel = new init()
D) public void init()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
32
The tag that begins every HTML document is ____.

A)
B)
C)
D)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
33
You override the existing empty ____ method only if you want to take some action when a JApplet is no longer visible.

A) hide()
B) onHide()
C) destroy()
D) stop()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
34
Usually, you place three attributes within the tag: code, width, and ____.

A) codebase
B) size
C) length
D) height
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
35
Invoking the ____ method after adding one or more JComponents to an applet ensures that the Components draw themselves on the screen.

A) draw()
B) paint()
C) repaint()
D) validate()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
36
When you write your own ____ method, you must include any actions you want your JApplet to take when a user revisits the JApplet.

A) repaint()
B) start()
C) paint()
D) restart()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
37
To run an applet from an HTML document, you add an and ___________________ tag pair.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
38
___________________ is a Swing class from which you can inherit to create your own applet.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
39
Which of the following cannot be performed with JApplets?

A) Use layout managers.
B) Add images and sounds.
C) Use a flow() method for layout.
D) Change label fonts/colors.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
40
With an applet, the browser can call ____ different methods automatically at different times.

A) two
B) three
C) four
D) five
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
41
What are the four steps involved in creating an applet?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
42
What are the three object tag attributes commonly used to run an applet?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
43
How do you view an applet?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
44
How is an applet like a Java application?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
45
Match each term with the correct statement below.
a.current version of HTML
f.tags
b.init()
g.multimedia
c.start()
h.applet
d.HTML
i.play()
e.Applet Viewer
Executes again every time the applet becomes active after it has been inactive
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
46
Explain lossless data compression and the image formats with which it is used.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
47
Match each term with the correct statement below.
a.current version of HTML
f.tags
b.init()
g.multimedia
c.start()
h.applet
d.HTML
i.play()
e.Applet Viewer
Describes the use of sound, images, graphics, and video in computer programs
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
48
Match each term with the correct statement below.
a.current version of HTML
f.tags
b.init()
g.multimedia
c.start()
h.applet
d.HTML
i.play()
e.Applet Viewer
Retrieves and plays the sound as soon as possible after it is called
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
49
Briefly describe the image formats that Java supports.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
50
How is an applet different from a Java application?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
51
Match each term with the correct statement below.
a.current version of HTML
f.tags
b.init()
g.multimedia
c.start()
h.applet
d.HTML
i.play()
e.Applet Viewer
Provides a convenient environment in which to test your applets
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
52
Match each term with the correct statement below.
a.current version of HTML
f.tags
b.init()
g.multimedia
c.start()
h.applet
d.HTML
i.play()
e.Applet Viewer
Surrounded by angle brackets
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
53
What are the two forms of the play() method?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
54
Match each term with the correct statement below.
a.current version of HTML
f.tags
b.init()
g.multimedia
c.start()
h.applet
d.HTML
i.play()
e.Applet Viewer
A simple language used to create Web pages for the Internet
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
55
Match each term with the correct statement below.
a.current version of HTML
f.tags
b.init()
g.multimedia
c.start()
h.applet
d.HTML
i.play()
e.Applet Viewer
The first method called in any applet
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
56
Describe the two methods for running an applet.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
57
Describe the stop() method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
58
What are the methods of the applet life cycle?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
59
Match each term with the correct statement below.
a.current version of HTML
f.tags
b.init()
g.multimedia
c.start()
h.applet
d.HTML
i.play()
e.Applet Viewer
A little application
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
60
Match each term with the correct statement below.
a.current version of HTML
f.tags
b.init()
g.multimedia
c.start()
h.applet
d.HTML
i.play()
e.Applet Viewer
Extensible Hypertext Markup Language
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
61
Write the statement to retrieve and play the myTune.au sound file that will be stored in the same place as the applet.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
62
There are three attributes typically placed within the tag: code, width, and height. Describe the purpose of the three object tag attributes and their corresponding arguments.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
63
public void actionPerformed(ActionEvent e)
{
String name = answer.getText();
con.remove(greeting);
con.remove(pressMe);
con.remove(answer);
personalGreeting.setText("Hello, " + name + "! ");
con.add(personalGreeting);
con.setBackground(Color.PINK);
validate();
}
In the actionPerformed() method above, the final statement following the addition of the JLabel is validate(). Explain the validate() method and how it is used with JComponents.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
64
In order to play sounds more than once, or to stop and start sounds, the sound must be loaded into an AudioClip object. Write the statement to load the AudioClip named myClip with the sound file myTune.au, which is located in the audio folder.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
65

Using the above statement, identify the three object tag attributes and their corresponding arguments.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
66

____________________


Using the HTML code above, write the statement to run a JApplet named JHello. The applet will be 450 pixels wide by 150 pixels tall.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
67
import java.awt.*;
import java.applet.*;
import javax.swing.*;
public class JSound extends JApplet
{
AudioClip sound;
public void init()
{
sound = getAudioClip(getCodeBase(),"mysteryTune.au");
}
public void start()
{
___________________________________
}
public void stop()
{
___________________________________
}
public void paint(Graphics g)
{
super.paint(g);
Graphics2D g2D = (Graphics2D)g;
g2D.drawString("Listen to the mystery tune ", 10, 10);
}
}
In the first shaded line provided, write the loop() method to play the mysteryTune.au sound continually. On the second shaded line, write the stop() method to halt the mysteryTune.au sound file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
68
import javax.swing.*;
import java.awt.*;
public class JHello extends JApplet
{
JLabel greeting = new JLabel("Hello. Who are you?");
public void init()
{
add(greeting);
}
}
The above code displays an applet with a JLabel added without a specified BorderLayout region. Describe how the JLabel will occupy the JApplet surface.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
69
arrowPicture.paintIcon(this, g, 150, 0);
The statement above is used to display the arrowPicture ImageIcon using the paintIcon() method. Describe the four arguments that are used in this method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
70
import java.awt.*;
import java.applet.*;
import javax.swing.*;
public class JCompanyImage extends JApplet
{
Image companyLogo;
final int WIDTH = 287;
final int HEIGHT = 129;
final int FACTOR = 2;
public void init()
{
companyLogo = getImage(getCodeBase(), "CompanyLogo. png");
}
public void paint(Graphics g)
{
super.paint(g);
// Draw image at its natural size
___________________________________
// Draw the image scaled - twice as large
___________________________________
}
}
Using the above code, complete the first shaded line with the statement to draw the image first in its original size in the upper-left corner. In the second shaded line, write the code to redraw the image at twice its original size using the WIDTH, HEIGHT, and FACTOR values.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
71
The init() method is the first method called in any applet. Write the code for the init() method header and explain the purpose of the init() method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
72

____________________________


In the blank line provided, write the code to run a JApplet named JGreeting that will be 370 pixels wide by 110 pixels tall.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 72 في هذه المجموعة.