This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
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.
Maneesh Godbole wrote:And this question is posted in the Swing/AWT/SWT/JFace forum because....?
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.
Joined: Mar 05, 2012
Michael Dunn wrote:is this any different to your other thread?
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..