Loading the Fish

The two fish images are fish1.gif, which points to the left, and fish2.gif, which points to the right. GIF images are a good choice here, because you can draw your images on a transparent background; as the fish move around, the square background on which they're drawn will not appear, because it's transparent—only the fish image will be visible. That means the fish will actually look like fish, not boxes, swimming around.

Besides loading the fish images, this is a good time to load the background image of bubbles, because the application needs to know how large that image is so it can size the window correctly. This application comes with a file named bubbles.gif that you can see as the background, as shown in Figure 1.1. However, ...

Get Java™ After Hours: 10 Projects You'll Never Do at Work now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.