• Post Reply Bookmark Topic Watch Topic
  • New Topic

Containers  RSS feed

 
Mike Lipay
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to handle non-text files in Java? I am trying to write an application that will store automotive history. It needs to accept and store non-text files, such as images (gif, jpg, png) and pdf files. Eventually, hoping to have the user drag-and-drop the file into a container on a swing interface.
 
Piet Verdriet
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mike Lipay:
Is there a way to handle non-text files in Java? I am trying to write an application that will store automotive history. It needs to accept and store non-text files, such as images (gif, jpg, png) and pdf files. Eventually, hoping to have the user drag-and-drop the file into a container on a swing interface.


"Handle non-text files" is a rather vague term. But the answer most probably is: yes, it is possible. Handling images can be done with the standard classes provided in the JDK [1], but for viewing (extracting text) and manipulating PDF files you will need some 3rd party library [2].

Good luck.

[1] http://java.sun.com/docs/books/tutorial/2d/index.html
[2] http://schmidt.devlib.org/java/libraries-pdf.html
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Those non-text files sound like BLOBs to me, which means you would want to put all that lot into a database.
You can access databases easily from Java code: look at this Tutorial.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!