• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling .TIF image in Swing

 
Nagaseshagiri poola
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Brian Pipa
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I beleive you can only use gif/jpg, or png images. Take a look at the Javadocs for Toolkit.getImage()
Brian
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic