Open Office in a Java Applet using OpenOffice.org API

October 22, 2011 | Open Source

Using OpenOffice.org API, you can manage the spreadsheet from your application only. This is simple flow for viewing spreadsheet in an Applet of Java.
Easy steps to view & manage Open Office in Java Applet:

  1. Download Java Development Kit (minimum version 6) and install using the article: http://poisure.com/2011/10/installing-java-on-windows/

  2. Download OpenOffice.org (OOo) from here: http://download.openoffice.org/, and install by clicking on downloaded exe file

  3. Remember the installed path (not unpacked path), lets assume the installed path of OpenOffice.org is: C:\Program Files\OpenOffice.org 3

  4. Set the following two System variables by going to ‘My Computer-> properties -> Advanced -> Environment Variables

    1. variable name: UNO_PATH
      variable value: C:\Program Files\OpenOffice.org 3\program (Change this path to installed folder of OpenOffice.org done in step 3)

    2. variable name: Path (if already exists append the variable value by clicking on ‘Edit’ button)
      variable value: C:\Program Files\OpenOffice.org 3\Basis\program\classes;c:\Program Files\OpenOffice.org 3\URE\Java;c:\Program Files\OpenOffice.org 3\URE\bin;c:\Program Files\OpenOffice.org 3\program

  5. Create Java project in your IDE with any name, lets say ‘OOoApplet‘. Download he class ‘OOoBeanViewer.java‘ from here: http://www.koders.com/noncode/fid62F0367775AB520C66F22B54E525E19503A4D174.aspx and copy into created project ‘OOoApplet‘ with proper package ‘com.sun.star.comp.beans

  6. If you already open the IDE before doing step 5, close & re-open the IDE

  7. Now run ‘OOoBeanViewer.java‘ class as Java Applet

  8. You can view the applet window with different options. Click ‘new document… -> Text Document‘ to see the Open Office Writer in applet.
    You can try different options over there

Open Office

OpenOffice.org

Tags: , , ,

Comments (5)

  1. lilou says:

    Hey there! Nice post! Please do keep us posted when I will see a follow up!

  2. TomWriteman says:

    Cool info to my mind. Thank u a lot for sharing this information.

    Tom Writeman
    camera signal jammer

  3. Thanks for ones marvelous posting! I really enjoyed reading it, you might be a great author.I will remember to bookmark your blog and will often come back in the future. I want to encourage that you continue your great work, have a nice morning!

  4. Glad to read this blog! Keep it going!

  5. Layla says:

    I have really enjoyied reading your well written article. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!

Leave a Reply

If you have a Tip, Comment, Article or anything you want to share, please send it to: i@poisure.com