• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Image or ImageIcon?

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic