File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes repaint() problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "repaint() problem" Watch "repaint() problem" New topic

repaint() problem

RavindraDSL Nandam

Joined: May 11, 2004
Posts: 6

Part A: initialize
GraphPane graphPane = graphDemo.graphPane;
graphPane.setXPoints(new int[1]);
graphPane.setYPoints(new int[1]);

Part B: repaint


Part C: should show new frame
GraphDemo graphFrame = new GraphDemo(controlPane,"DisplayGraph");

As the "GraphDemo.getContentPane().repaint()" starts new thread.
Part C is not waiting for Part B to be completed. so it is not showing the initializing on Panel.

Solution i am looking for is:- aftet the repaint() method is complete then i wanted the Part c to be processed.
Is there anyway i can do this.... I heard that there are some methods like invokewait and invokelater() in the swing utilities. I dont know how to use them.

If anyone helps me, i would be grateful... as the deadlines are very tight.

Bjørn Børresen

Joined: May 03, 2004
Posts: 8
put it in a thread in invokeLater():

[ June 08, 2004: Message edited by: Bj�rn B�rresen ]

expressionengine freelancer - standalone registration form for expressionengine
I agree. Here's the link:
subject: repaint() problem
It's not a secret anymore!