Displaying Open Office word doc in browser using JavaFX

My requirement is to display open office doc in my application for modification

Hi. The following works for Microsoft Word docs and Notepad.
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.stage.Stage;
* @author gusaros
public class OpenOffice extends Application {
     * @param args the command line arguments
    public static void main(String[] args) {
        Application.launch(args);
    @Override
    public void start(Stage primaryStage) {
        primaryStage.setTitle("Hello World");
        Group root = new Group();
        Scene scene = new Scene(root, 300, 250);
        Button btn = new Button();
        btn.setLayoutX(100);
        btn.setLayoutY(80);
        btn.setText("Hello World");
        btn.setOnAction(new EventHandler<ActionEvent>() {
            public void handle(ActionEvent event) {
                String[] cmdArray = {"cmd", "/c", "start", "c:\\fdres.doc"};
                try {
                    java.lang.Runtime.getRuntime().exec(cmdArray);
                } catch (Exception s) {
        root.getChildren().add(btn);
        primaryStage.setScene(scene);
        primaryStage.show();
}

Similar Messages

  • Will I be able to open my 2004 word docs in Lion using Pages?  How about Powerpoint using Keynote?

    Will I be able to open my 2004 word docs in Lion using Pages?  How about 2004 Powerpoint using Keynote?

    KT35 wrote:
    My word 2004 won't open, it says you can't open the aplication Microsoft Word because power PC applications are no longer supported". How can I get it to work?
    You can't.
    The components of MS Office 2004 (which includes Word 2004) are PowerPC apps. In order to run PowerPC apps in Snow Leopard and earlier on an Intel Mac required the assistance of Rosetta software. Lion does not support Rosettta, so such apps can not be used in Lion.
    In order to use your documents in Lion, you will need to -
    • update the apps to a current version, ones which do work in Lion
    • migrate the docs to other compatible apps which do run in Lion, such as Pages.

  • Snow leopard  to lion so I could use cloud. Now I can't open any word doc. that I receive in emails. Is there any way to remedy this?

    My Macbook pro came with snow leopard. I decided to upgrade to lion so I could use cloud. Now I can't open any word doc. that I receive in emails. Is there any way to remedy this?

    You don't tell us what version of Office for Mac you presently have, but I'm guessing it might be Office for Mac 2004. If so, in addition to the suggestion to download OpenOffice you can purchase the most recent version of Office for Mac 2011 directly from MS <http://www.microsoft.com/mac/buy>. You can also purchase Pages productivity suite from the Mac App Store <http://itunes.apple.com/us/app/pages/id409201541?mt=12>.

  • I am looking for an application that would allow me to open a word doc, and take notes in the .doc using a stylus pen.  I'd then like to convert those notes to text, and then be able to copy / paste those notes into an email.  Does this app exist?

    I am looking for an application that would allow me to open a word doc, and take notes in the .doc using a stylus pen.  I'd then like to convert those notes to text, and then be able to copy / paste those notes into an email.  Does this app exist?  It seems like we were doing these same types of things with Palm Pilots years ago, one would think this would work with iPads?

    I don't believe it will open a Word document, but Writepad allows for handwritten conversion of notes to text and then to email. Might help you some of the way...

  • I have a mac g 5 and i uploaded Microsoft Office 2008 for my 90 year old mother. Now when she tries to open earlier word docs, they won't open at all  :-(  what happened?

    HELP!!! i have a mac g 5 and i uploaded Microsoft Office 2008 for my 90 year old mother. Now when she tries to open earlier word docs, they won't open at all  :-(  what happened?  I SEE THE WORD IN THE NAVIGATION BAR BELOW, but when she tries to open a word doc, the navigation bar opens and closes around the Word symbol and nothing happens :-(  i'm going crazy :-( PLEASE CAN SOMEONE HELP AND LET ME KNOW WHAT TO DO?

    If you have not already done so, repair permissions and restart your computer.  Or boot up from your install DVD and run "Repair Disk" from the Utility menu.  When done, restart back to your desktop, repair permissions and restart your computer. Suggest that you post in the Microsoft Office for Mac Forums if the above does not work. 
     

  • Performance issue when opening DOCX Word Doc with Excel Links

    Is this a bug or is there a config setting that can prevent Word from needlessly opening Excel repeatedly (upon initial open of a DOCX Word doc) when pre-existing links should NOT be updated. The behavior is good using 2003 formats (DOC & XLS),
    but varies significantly (~100:1 range in performance) depending on the test scenario (see below) using DOCX with XLSX.
    We can't move our environment to the new XML formats until we can find a fix. We were led to believe Microsoft knew this to be a bug in Office 2007, but it has NOT been corrected in Office 2010. Omitting a detailed explanation for why we need to
    do this, here's our test scenarios:
    -Currently testing Office 2010 Pro Trial version on WIN XP SP3. (We have found similar results using Office 2007 with Win7 or XP).
    -Word Option Deselected/DISABLED: "Update Automatic Links at Open"
    -The Word Doc contains 100 linked Excel tables and is 130K in size (DOCX).
    -Each link points to the same 10x10 cell range in one Excel Workbook located in same directory as the Word Doc, although other tests using separate directories produced similar results.
    -The Excel Links were inserted into Word via Paste Special/Paste Link/MS Excel Worksheet Object.
    -The workbook (XLSX) is 15K in size.
    -All Links are set for "Manual" update, our testing showed no difference if links are set to "Auto".
    -Again, Word is set to NOT update Automatic links when the document is opened.
    -Results shown below are for local hard drive test.
    -Network response times are slightly greater on 100mb LAN
    -Word is completely restarted prior to each test to make sure there's no application caching involved.
    LOCAL DRIVE RESPONSE TIMES TO OPEN THE WORD DOC in Docx format:
    1. Open the Word Doc from Word with Excel closed - 175 seconds (Excel appears to be opened and closed once per link)
    2. Open the Word Doc from Word with Excel open & workbook closed - 33 seconds (Excel appears to be accessed once per link)
    3. Open the Word Doc from Word with the linked workbook already open - 7 seconds (Excel appears to be accessed once per link)
    4. Rename Excel XLSX workbook so that Word can't find it. Then open Doc the from Word. 1-2 seconds (Excel does not appear to be invoked)
    5. Repeat ALL of the above scenarios 1-4 using DOC and XLS files. These files are created with "Save AS" option based on original test files and then re-pasting the links.  1-2 seconds to open the Word Doc (Excel does not appear to be invoked)
    Summary
    Using DOCX/XLSX, if Word can't find the linked spreadsheet it gives up and performs nicely during file-open. Otherwise, Word performs needless, time-consuming access to Excel, and in the worst case, opens and closes Excel repeatedly in the background.
    Testing with DOC/XLS formats gives good performance across all scenarios.

    It is a known bug and one for which AFAIK, there has been no fix.  The only way that I could get around it in a particular application was to do something like save the linked information as document variables and then on opening the document recreate
    all the information.  My memory on exactly what I did is a bit hazy, but I can go back and check if you are interested.
    -- Hope this helps.
    Doug Robbins - Word MVP,
    dkr[atsymbol]mvps[dot]org
    Posted via the Community Bridge
    "galmcrantz" wrote in message news:[email protected]...
    Is this a bug or is there a config setting that can prevent Word from needlessly opening Excel repeatedly (upon initial open of a DOCX Word doc) when pre-existing links should NOT be updated. The behavior is good using 2003 formats (DOC & XLS), but varies
    significantly (~100:1 range in performance) depending on the test scenario (see below) using DOCX with XLSX.
    We can't move our environment to the new XML formats until we can find a fix. We were led to believe Microsoft knew this to be a bug in Office 2007, but it has NOT been corrected in Office 2010. Omitting a detailed explanation for why we need to do this,
    here's our test scenarios:
    -Currently testing Office 2010 Pro Trial version on WIN XP SP3. (We have found similar results using Office 2007 with Win7 or XP).
    -Word Option Deselected/DISABLED: "Update Automatic Links at Open"
    -The Word Doc contains 100 linked Excel tables and is 130K in size (DOCX).
    -Each link points to the same 10x10 cell range in one Excel Workbook located in same directory as the Word Doc, although other tests using separate directories produced similar results.
    -The Excel Links were inserted into Word via Paste Special/Paste Link/MS Excel Worksheet Object.
    -The workbook (XLSX) is 15K in size.
    -All Links are set for "Manual" update, our testing showed no difference if links are set to "Auto".
    -Again, Word is set to NOT update Automatic links when the document is opened.
    -Results shown below are for local hard drive test.
    -Network response times are slightly greater on 100mb LAN
    -Word is completely restarted prior to each test to make sure there's no application caching involved.
    LOCAL DRIVE RESPONSE TIMES TO OPEN THE WORD DOC in Docx format:
    1. Open the Word Doc from Word with Excel closed - 175 seconds (Excel appears to be opened and closed once per link)
    2. Open the Word Doc from Word with Excel open & workbook closed - 33 seconds (Excel appears to be accessed once per link)
    3. Open the Word Doc from Word with the linked workbook already open - 7 seconds (Excel appears to be accessed once per link)
    4. Rename Excel XLSX workbook so that Word can't find it. Then open Doc the from Word. 1-2 seconds (Excel does not appear to be invoked)
    5. Repeat ALL of the above scenarios 1-4 using DOC and XLS files. These files are created with "Save AS" option based on original test files and then re-pasting the links.  1-2 seconds to open the Word Doc (Excel does not appear to be invoked)
    Summary
    Using DOCX/XLSX, if Word can't find the linked spreadsheet it gives up and performs nicely during file-open. Otherwise, Word performs needless, time-consuming access to Excel, and in the worst case, opens and closes Excel repeatedly in the background.
    Testing with DOC/XLS formats gives good performance across all scenarios.
    Doug Robbins - Word MVP dkr[atsymbol]mvps[dot]org

  • How to switch from a word doc to another using a keyboard shortcut?

    how to switch from a word doc to another using a keyboard shortcut?

    Cmd+tilde to switch between open Word documents, or
    Cmd+tab to switch between open applications, if that's what you are after?

  • How do I  set the default view size when I open a word.doc from mail

    I use the mail program all day long and open MS Word docs and the size is default of 100% but the actually view of the screen make it look like a font of 7 or 8
    I have a difficult time even viewing the document until I blow it up to 150%. It's not because I'm blind I have excellent vision..
    HOW DO I SET THE DEFAULT VIEW OF DOCUMENTS

    This document can help you set the print settings for any type of printing. Not just for photos as the title suggests. You should not have to keep setting it every time.
    Printer settings
    007OHMSS
    I was a support engineer for HP.
    If the advice resolved the situation, please mark it as a solution. Thank you.

  • Why can't I open some word docs on the iPad2?

    Someone at my work has an iPad2. He has a problem of not able to open some word docs. Does anyone reconize this and what is the solution? Thank you.

    Is there an app installed that's capable of reading Word and other Office files such as QuickOffice or DocsToGo?

  • OS 10.8 will not open my word docs, what is the solution?

    I installed OS 10.8 after upgrading the ram .System works quicker but it will not allow me to open older Word docs. Is there an equivalent in the enclosed software or what external software will work ?Thanks
    jeff293

    The inputs by erict43 and Paul_31 are absolutely correct. Happened to me when I upgraded to Lion. Had Office 2004. Didn't work. Upgrade to Office 2011 and everything will be fine. You can download Office for students at a reasonable price. All your old Office files will be there and when opened and saved again will upgrade themselves to Office 11.
    Microsoft and Apple have to keep us buying somehow....
    Good luck,
    Virg

  • How do I set Pages to automatically open all Word (.doc) documents?

    Being a relatively new Mac User, I haven't yet figured out how to associate programs with particular file types.
    How do I set Pages to automatically open all Word (.doc) documents?
    Thanks.

    Hello Argelius
    If you select a word file in the Finder and do File>Get Info you will see a section in there where you can specify which application should be used to open files of that type.

  • How can i bring in a office word doc into my iphone

    how can i bring in a office word doc into my iphone

    Email it, then tap the attachment on your iPhone to view it.  Or, upload it to a cloud service like Dropbox and use the free dropbox app to access it.

  • I cannot open my word doc on my iMac.  I got this error message, The applicThe aplation Microsoft Word can't be opened.?

    I cannot open my word doc on my imac.  I got this error message, "The application microsoft word cannot b opened" #1712. Can you help?

    Word can't open or does it open but you can't open documentts?
    If you have Office does Excell or Power Point open? If they do you can perhaps check for updates with either of them: Help > Check for Updates. You can also try to reinstall Office with your installation disks. Don't delete Office, just try to install it again.

  • Opening a Word doc

    Hello all, I am new to Flex.  I have some experience with AS3 (still switching over from AS2).
    Anyway, I am making a Flex project where I have a text link in a datagrid.  This link needs to open a word document that is on our company network.  Currently I'm working on my own personal computer on my C drive (not sure if that affects anything - when i hit Run does it run the application from my C drive? It should still work from there i'd think?)  We have a bunch of other drives on our network, and the word doc I'm trying to open is on a "P:" drive.
    I'm not sure what I might be doing wrong, but I created a LinkButton and tried 2 different attempts at opening a Word doc.
    I tried creating a new URLRequest and navigateToURL to attempt to open the word doc - nothing happens when I click the link. The link button will launch google if i replace my word doc path with the google url.
    I tried sending the file path to javascript via ExternalInterface and having javascript open it up.  It doesn't work that way either.
    Is there something I should know about opening up a Word doc file with Flex? Or possibly is it not working because of where the file resides?  Any thoughts?
    Thanks
    -Michele

    Actually, no and yes. No you do not have to re-save all of your Word files. It depends on what you want to do with them.
    The file you have open is actually a Pages file which was created by converting the old Word file (which has not been altered at all). If you want to keep it and any changes you have made as a Pages file, you must "save as." The next time you open that file, it will open naturally in Pages. Every time you open the original Word file, since it has not been converted to native Pages, it will go through the same translating process as it did this time.

  • If i upgrade from pages 2.0.2 to pages 4.1 will i be able to open older word docs on lion

    Before I buy pages 4.1 I was just checking that I be able to open older word docs, since installing lion we have not been able to open older word docs. Many Thanks

    Test by yourself with the documents which you wish to open.
    Dowload the free 30 days trial iWork from :
    http://www.apple.com/iwork/download-trial/
    install it,
    apply the updaters then test it during 30 days.
    An other scheme which costs nothing is to download the free LibreOffice.
    Yvan KOENIG (VALLAURIS, France) vendredi 24 février 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.3
    My Box account  is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

Maybe you are looking for

  • Error message please help me!

    Last time I opened iTunes it showed an error message and I could only press the button OK. As I did all the songs were gone and my iTunes was empty. As I uploaded everything again this happened a second time! I don't know what to do!?

  • Need to read text file content and have to display it in multiline text box

    dear all, Need to read text file content and have to display it in multiline text box. actually im new to file handling. i have tried up to get_line and put_line. in_file := TEXT_IO.FOPEN ('D:\SAMPLE.txt', 'r'); TEXT_IO.GET_LINE (in_file,linebuf); i

  • How do you display ID3 tag info?

    Does anyone know how to display detailed id3 tag info for a song that is playing? I'm looking for a display of the bitrate, genre, file size, track number, etc. I've tried pressing the center button a few times as suggested by the manual, but it does

  • Email with pdf attached..

    Can you please post sample code how to send email using pl/sql proc with password protected pdf attched. I am using SMTP setting with DEMOmail.

  • Is there any tool for developing Postscript code ?

    Hi Friends, Is there any tool for developing Postscript code ? (or) Is there any IDE for Postscript ? (or) Thanks & Regards, Navaneeth Sivappan