File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes calling .TIF image in Swing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "calling .TIF image in Swing" Watch "calling .TIF image in Swing" New topic

calling .TIF image in Swing

Nagaseshagiri poola

Joined: Oct 18, 2003
Posts: 25
i am calling the .TIF format picture in the swing application and it is not showing any error and not displaying the image i requested.
my code looks like this
JLabel img = new JLabel("", new ImageIcon("index.TIF"), JLabel.CENTER)
but the image is not displayed and i tried with .gif and .jpeg and its working fine.
can somebody help me
thank you
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

The JRE only provides support for GIF, JPEG, and PNG images. For any other image types, you'll have to use JAI (Java Advanced Imaging API) or a third party class for TIFF decoding.

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Brian Pipa
Ranch Hand

Joined: Sep 29, 2003
Posts: 299
I beleive you can only use gif/jpg, or png images. Take a look at the Javadocs for Toolkit.getImage()

My Java Freeware:<br />MACCC - <a href="" target="_blank" rel="nofollow"></a><br />Nator - <a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: calling .TIF image in Swing
It's not a secret anymore!