| View previous topic :: View next topic |
| Author |
Message |
nika90 Newbie

Joined: 13 Aug 2010 Posts: 1
|
Posted: Wed Sep 29, 2010 6:39 am Post subject: OOO Calc jFrame Problem [ OfficeBean.jar ] |
|
|
Dear Colleagues ,
We are using OpenOffice.org.calc 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 com.sun.star.comp.beans.OOoBean.
4. In another thread we are initializing com.sun.star.comp.beans.OOoBean 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.
OpenOffice.org Calc in jFrame usage Diagram
http://www.openoffice.org/nonav/issues/showattachment.cgi/71894/OpenOffice.org.CALC.jFrame.Diagram.JPG
Screenshot when OpenOffice Sheet not displayed.
http://www.openoffice.org/nonav/issues/showattachment.cgi/71895/OpenOffice.org.CALC.jFrame.Problem.Screen.jpg
Screenshot after resizing or Minimizing & Maximizing the frame - everything looks as it should be.
http://www.openoffice.org/nonav/issues/showattachment.cgi/71896/OpenOffice.org.CALC.jFrame.AfterResizing.or.MinMax.jpg
Any help is very welcome! |
|
| Back to top |
|
 |
lyt1984 Newbie

Joined: 01 Aug 2011 Posts: 1
|
Posted: Mon Aug 01, 2011 9:14 am Post subject: I had the same problem |
|
|
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...
| Code: | | public class MyFrame extends JFrame implements Runnable{ .... |
And the MyFrame class, must define the run() method
| Quote: | 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 {
Thread.sleep(sleep);
} catch (InterruptedException e) {
System.out.println("interrupted");
}
beforeTime = System.currentTimeMillis();
}
} |
So, in my main(), I call it as a thread...
| Code: | MyFrame myFrame= new MyFrame ();
Thread t1 = new Thread(myFrame);
t1.start();
|
|
|
| Back to top |
|
 |
|
|
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
|