• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Single window to open document formats

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've created separate classes for opening document formats like rtf, pdf, html and txt. But all these open in separate windows as they call different classes. I actually want to make a single file chooser which can open all these documents in a single window depending upon the file extension. Please suggest the method.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And this question is posted in the Swing/AWT/SWT/JFace forum because....?
Please TellTheDetails
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is this any different to your other thread?

https://coderanch.com/t/569483/GUI/java/Displaying-pdf-rtf-files
 
Yogesh Pavan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Maneesh Godbole wrote:And this question is posted in the Swing/AWT/SWT/JFace forum because....?
Please TellTheDetails



Because we're developing the java app using swings to open different document formats in a single application. Below is the attached screenshot of main window our current application which opens .txt, .rtf, .pdf and .html files.. But our concern is, the application opens separate windows to open each of the file formats instead of showing the single file chooser for all of these document formats as we were unable to create a single file chooser and choose the file to open depending upon the format filter in the file chooser like either *.pdf or *.rtf...
So, please suggest us how to build a single file chooser and open these document files depending upon their formats..
Thanks in advance.
dg.jpg
[Thumbnail for dg.jpg]
 
Yogesh Pavan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Michael Dunn wrote:is this any different to your other thread?

https://coderanch.com/t/569483/GUI/java/Displaying-pdf-rtf-files



yes sir, little different.. we want to open the documents from a single file chooser based on various document formats.. so when we choose *.pdf file is the file chooser, the jpedal library need to be called in the code and it must open the pdf file.. and when we choose *.rtf files, rtfeditorkit need to be called and it must open the rtf file in other window.. But currently we've made seperate buttons to open each of these files.. Please find the snapshot attached and kindly suggest what we need to do to make it happen..
We're actually a team of two students making a project for our college..
Thanks in advance..
dg.jpg
[Thumbnail for dg.jpg]
This snapshot shows the main window which has multiple buttons to open each document formats.
reply
    Bookmark Topic Watch Topic
  • New Topic