• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Viewer Error  RSS feed

 
Tapan Agarwal
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to use ImageIO.jar to view documents.
I have been able to view .tiff, .bmp, .jpeg and .png files.
However when I try to open files with extensions .pdf, .docx, .txt I get an error-

Exception in thread "main" java.lang.NullPointerException
at javax.swing.ImageIcon.<init>(Unknown Source)
at org.taps.cm.View.main(View.java:27)


The code I am using is -



I am guessing the viewers does not support these files.
Is there any other viewers I can use to open such files.


Thanks.
 
Dave Tolls
Ranch Foreman
Posts: 3065
37
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ImageIO is for reading in image formats.

Those other formats are document formats, not images.
 
Charles D. Ward
Ranch Hand
Posts: 99
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A PDF file or a doc file are obviously not images.
 
Tapan Agarwal
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK thats resolves one of my doubts
Is there any JAVA viewers available for pdf and docs file?
 
Stephan van Hulst
Saloon Keeper
Posts: 7992
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java word document
java pdf document
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java, not JAVA. It's not an acronym.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!