18.11. Review Questions

 
[Page 565 ( continued )]

Review Questions

Sections 16.2 “16.4

16.1 Is every applet an instance of java.applet.Applet ? Is every applet an instance of javax.swing.JApplet ?
16.2 Describe the init() , start() , stop() , and destroy() methods in the Applet class.
16.3 How do you add components to a JApplet ? What is the default layout manager of the content pane of JApplet ?
16.4 Why does the applet in (a) display nothing? Why does the applet in (b) have a runtime NullPointerException on line 12?
[Page 566]

Sections 16.5 “16.6

16.5 Describe the <applet> HTML tag. How do you pass parameters to an applet?
16.6 Where is the getParameter method defined?
16.7 What is wrong if the DisplayMessage applet is revised as follows ?
16.8 What are the differences between applications and applets? How do you run an application, and how do you run an applet? Is the compilation process different for applications and applets? List some security restrictions on applets.
16.9 Can you place a frame in an applet?
16.10 Can you place an applet in a frame?
16.11 Delete super.paintComponent(g) on line 97 in TicTacToe.java in Listing 16.7 and run the program to see what happens.

[Page 567]

Sections 16.9 Locating Resource Using the URL Class

16.12 How do you create a URL object for the file http://www.cs.armstrong.edu/liang/intro6e/book/audio/us.mid on the Internet? How do you create a URL object for the file http://www.cs.armstrong.edu/liang/audio/us.mid in the class directory?
16.13 How do you create an ImageIcon from the file image/us.gif in the class directory? How do you create an ImageIcon from www.cs.armstrong.edu/liang/intro6e/book/image/us.gif?

Section 16.10 Playing Audio

16.14 What types of audio files are used in Java?
16.15 How do you create an audio clip from a file anthem/us.mid in the class directory? How do you create an audio clip from http://www.cs.armstrong.edu/liang/intro6e/book/audio/us.mid?
16.16 How do you play, repeatedly play, and stop an audio clip?
 


Introduction to Java Programming-Comprehensive Version
Introduction to Java Programming-Comprehensive Version (6th Edition)
ISBN: B000ONFLUM
EAN: N/A
Year: 2004
Pages: 503

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net