Previous Section  < Day Day Up >  Next Section

Quiz

Animate yourself as much as you can muster and answer the following questions to test your skills.

Questions

1:

Where is the (0,0) coordinate on a container?

  1. In an off-screen double-buffering area

  2. The exact center of the window

  3. The upper-left corner of the applet window

2:

What thing did you not learn during this hour?

  1. How to load images in an application

  2. How to make sure an image is not displayed until it loads

  3. Why the tennis ball is bouncing off thin air instead of the ground in the BouncePanel application.

3:

In a threaded animation applet, where should you handle most of the movement of an image?

  1. The run() method

  2. The init() method

  3. The paint() method

Answers

A1:

c. The x value increases as you head to the right, and the y value increases as you head downward.

A2:

c. Would you believe clear-air turbulence?

A3:

a. Some movement might be handled by statements in the paint() method, but most of it will take place in run() or a method called from within run().

    Previous Section  < Day Day Up >  Next Section