aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Image or ImageIcon? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Image or ImageIcon?" Watch "Image or ImageIcon?" New topic
Author

Image or ImageIcon?

Gad Flailimbs
Greenhorn

Joined: Mar 21, 2007
Posts: 15
I'm curious as the best Image object to use when you're tossing about 100+ images onto a JPanel at a time. I believe ImageIcon extends Image but is it pointless to use it on such a large scale?

Thanks for the info!


Java Game:<br /><a href="http://pokemon.ele-mentalfury.com/" target="_blank" rel="nofollow">http://pokemon.ele-mentalfury.com/</a><br />Webcomic:<br /><a href="http://ele-mentalfury.com/" target="_blank" rel="nofollow">http://ele-mentalfury.com/</a>
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
tossing about 100+ images onto a JPanel at a time. I believe ImageIcon extends Image but is it pointless to use it on such a large scale
According to the ImageIcon class api ImageIcon extends Object and implements the Icon interface (among others). It allows "easy" loading, can draw itself, can hold a descriptive String and is used in Swing components such as JLabel and extensions of AbstractButton. If you don't need some of these things you could use an array of BufferedImage or, if you don't mind dealing with Generics, an ArrayList.
Gad Flailimbs
Greenhorn

Joined: Mar 21, 2007
Posts: 15
Thanks for the info. I was more curious for anyone who has had personal experience with an alternative on a similar scale.

With what you've just said it seems ImageIcon is probably best choice for animated character images and other stuff I'm looking at. Thanks again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Image or ImageIcon?
 
Similar Threads
ImageIcon performance
Image not displayed in JLabel using Swing
How to Create Image In a Frame
Importing images using Swing
Is it okay to use images found on the web?