• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Image or ImageIcon?

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic