| 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.
|
 |
 |
|
|
subject: Image or ImageIcon?
|
|
|