#What's the different between ImageIcon and Image?
1 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @nimble marsh! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
from the docs:
An implementation of the
Iconinterface that paints Icons from Images
there are other implementations of Icon but this specific one uses Image
when adding to a button/label/etc, those things expect an Icon , so you use an ImageIcon to say "hey here's the icon you wanted, shhh don't tell anybody but it's actually just an image"
What does "paints Icons from Images" mean? (What's the difference between Images and Icons here?)
And here
Thanks.
an Icon can be sourced from various locations (e.g. a reference from the OS, a Look-and-Feel (LAF), etc.) - ImageIcon is a specialisation of Icon that sources it from an Image
if we look at "All Known Implementing Classes" here:
we can see that there are other implementations of Icon that aren't from an Image (most of them reference "Metal" which is the built-in java look-and-feel)
got it! Thanks 🙂
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.