The spin button sample enlarges or reduces image data using the component (called SpinButtonLong) combining the JFSpinButton class with JFFieldLong class.
The spin button sample uses the following classes:
JFSpinButton
JFFieldLong
Figure 1.18 Spin button sample
Operation method
List box section (Choice)
Select the image data to be displayed with Choice.
Sample data uguisu.gif, umineko.gif, ooruri.gif, and tobi.gif are provided.
File
Pressing this button opens the [File Selection] dialog; therefore, the user image data can also be displayed.
Specifiable image data types are GIF and JPEG formats.
Width and Height
Operating the spin button arrow using the mouse or keyboard enlarges or reduces the image data.
The input field of the spin button changes as follows, depending on the image data size.
The image data is displayed in white for the actual image size.
The image data is displayed in light blue when the image data is reduced.
The image data is displayed in red when the image data is enlarged.
Source codes
Spin button sample:"Sample Storage Destinations"/jfspinbutton/JFSpinButtonSample.java
Spin button with the input field:"Sample Storage Destinations"/common/SpinButtonLong.java
Image panel:"Sample Storage Destinations"/jfspinbutton/ImagePanel.java