Forum at OOoForum.orgThe Forum
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

OOO Calc jFrame Problem [ OfficeBean.jar ]

Post new topic   Reply to topic Forum Index -> Macros and API
View previous topic :: View next topic  
Author Message

Joined: 13 Aug 2010
Posts: 1

PostPosted: Wed Sep 29, 2010 6:39 am    Post subject: OOO Calc jFrame Problem [ OfficeBean.jar ] Reply with quote

Dear Colleagues ,

We are using for reporting in JFrame using following
steps :

    1. Initializing swing/awt components (creating JPanel to insert OO.calc table in it)
    2. Initializing table (inserting data in the table from database)
    3. Initializing OpenOffice.calc table with using class
    4. In another thread we are initializing class(initializng fonts,colours etc).
    5. Adding OOoBean s components in javax.swing.JPanel ,after that adding this panel to javax.swing.JFrame

The problem is : sometimes after the steps mentioned above table is not shown
in window(JFrame). it needs to do some action to make it visible , for
example: (a) minimize and maximize or (b) resize frame window. I think this is
a repaint problem which I don’t know how to solve. This problem appears in
different systems , different computers, different time, different OOO versions
(2.4, 3.0, 3.2) and with different locale and regional settings. Please see
some screenshots attached. Calc in jFrame usage Diagram

Screenshot when OpenOffice Sheet not displayed.

Screenshot after resizing or Minimizing & Maximizing the frame - everything looks as it should be.

Any help is very welcome!
Back to top
View user's profile Send private message Send e-mail

Joined: 01 Aug 2011
Posts: 1

PostPosted: Mon Aug 01, 2011 9:14 am    Post subject: I had the same problem Reply with quote

Hello nika90.

I had the exact same problem.
In my program, A JFrame contains a JPanel, that contains a OOoBean.

I am not sure about what causes this, but i call the validate() method from my instance of JFrame.

In my case, my JFrame implements Runnable...

public class MyFrame extends JFrame implements Runnable{ ....

And the MyFrame class, must define the run() method
public static long DELAY = 30;
public void run() {
long beforeTime, timeDiff, sleep;
beforeTime = System.currentTimeMillis();
while (true) {
this.validate(); //solved the problem of showing the office only after a resize
timeDiff = System.currentTimeMillis() - beforeTime;
sleep = DELAY - timeDiff;

if (sleep < 0)
sleep = 3;
try {
} catch (InterruptedException e) {

beforeTime = System.currentTimeMillis();

So, in my main(), I call it as a thread...
MyFrame myFrame= new MyFrame ();
      Thread t1 = new Thread(myFrame);
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Forum Index -> Macros and API All times are GMT - 8 Hours
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2005 phpBB Group