Question

When attemting to make a simple application which uses an image I was amazed at the large number of image types available to me. I did a search on them and whilst finding a little about them cannot work out what image is ment to be used in what circumstances.

The types of image I am confused about are Image, ImageIcon, and ImageIO.

Was it helpful?

Solution

  • The only one of those that is an image is Image. A more powerful sub-class of Image is BufferedImage.
  • An ImageIcon is an image based Icon.
  • ImageIO simply helps us to read and write images, and do other things with images.

Be sure to check the JavaDocs for each. It adds more details.

Image | BufferedImage | ImageIcon | ImageIO

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top