February 2014
Beginner
1248 pages
62h 25m
English
Icons are a popular way to enhance the look-and-feel of an application and are also commonly used to indicate functionality. For example, the same icon is used to play most of today’s media on devices like DVD players and MP3 players. Several Swing components can display images. An icon is normally specified with an Icon (package javax.swing) argument to a constructor or to the component’s setIcon method. Class ImageIcon supports several image formats, including Graphics Interchange Format (GIF), Portable Network Graphics (PNG) and Joint Photographic Experts Group (JPEG).
Line 28 declares an ImageIcon. The file bug1.png contains the image to load and store in the ImageIcon object. This image is included ...
Read now
Unlock full access