Java Reference
In-Depth Information
Figure 15-3
.
Drop operation completed
How It Works
This recipe is a simple application that allows you to view images having file formats
such as
.jpg
,
.png
, and
.gif
. Loading an image requires using the mouse to drag-
and-drop a file onto the window area. The application also allows you to resize the
window, which automatically causes the image to scale while maintaining its aspect ra-
tio. After a few images are successfully loaded, you will be able to page through each
image conveniently by clicking the left and right button controls, as shown in
Figure
Before the code walk-through, let's discuss the application's variables.
Table 15-1
describes instance variables for this sleek image viewer application.