ImageIcon : Java Glossary


A Swing class for encapsulating an Image and provides built-in MediaTracker for it. It is not a JComponent, so it cannot on its own display the Image. There are constructors that will let you fetch the Image from an Image object, or from a file or from an URL (Uniform Resource Locator). There is no constructor to fetch the image directly from a resource. You must use getResource to get you the URL of the resource in the jar given its name and feed that to the ImageIcon constructor.

You most commonly use an ImageIcon with JLabel. setIcon, JButton.setIcon or JCheckBox.setIcon.

Learning More

Oracle’s Javadoc on ImageIcon class : available:

This page is posted
on the web at:

Optional Replicator mirror
on local hard disk J:

Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

Your face IP:[]
You are visitor number