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.
Oracle’s Javadoc on ImageIcon
class : available: