You can't really compare the two. An ImageIcon is an implementation of Icon that happens to use an Image as its source (hence the name). So you use Image in places where you need an Image (like when drawing, a window's icon) and (Image)Icon where you need an Icon (JLabel, JButton).
I'll answer your second question first: no, ImageIcon's usage is most certainly not restricted to Applets. It can be used wherever an Icon is required and an Image is available for constructing the desired (Image)Icon.
Read the Icon API for a better understanding. A simple implementation of Icon is a set of drawing instructions (the paintIcon method) and knows its size (getWidth, getHeight). That's all.
From the API for ImageIcon:
An implementation of the Icon interface that paints Icons from Images.
And the answer to your first question is: they are different classes, with different methods and constructors, in different packages... don't even try to compare them.
There are no new questions, but there may be new answers.
posted 11 years ago
Blood pressure normal? What do I change to get "magnificent"? Maybe this tiny ad?