|
|
|
|||
|
Displaying a Sequence of ImagesThe example in this section gives you the basics of displaying an image sequence. The next section has hints for improving the appearance and performance of this animation. This section shows only applet code. The code for an application would be similar, except you would use different code to load the images, as described in Loading Images.Below are the ten images this applet uses.
T1.gif:
Here's a picture of what the applet looks like. Remember that you can click on the applet to stop or start the animation. ![]() This is a picture of the applet's GUI. To run the applet, click the picture. The applet will appear in a new browser window.
The code for this example,
in
Another way to implement this example
would be to use a label to display the image.
Instead of having custom painting code,
the program would use the setIcon method
to change the image displayed.
| |||
|