Java 1.4 Image IO inside of Swing components.
1 posts in topic
Flat View  Flat View

Posted By:   William_Gates
Posted On:   Thursday, April 18, 2002 02:49 PM

Where might I find some information on how to place an object from the new ImageIO class into swing components. Like, say I want to take an Image, such as a tiff, and display that in a swing window. How might one go about doing so?

Re: Java 1.4 Image IO inside of Swing components.

Posted By:   Christopher_Schultz  
Posted On:   Friday, April 19, 2002 07:38 AM

I'm not sure about v1.4, but in previous versions, once you had a java.awt.Image object, you can use java.awt.Component.drawImage to draw that image on pretty much anything.

Generally, you would do this in a paint() callback on that component, or use the Swing class javax.swint.ImageIcon, which is a component you can slap into any Container, like a JPanel or a JFrame.

Hope that helps,

About | Sitemap | Contact