wood burning stoves 2.0*
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
Author

repaint() problem

RavindraDSL Nandam
Greenhorn

Joined: May 11, 2004
Posts: 6
Hi,

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

Part B: repaint

GraphDemo.getContentPane().repaint();
controlPane.getGraphConfig().setXPoints(null);
controlPane.getGraphConfig().setYPoints(null);

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


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.

Regards,
Ravindra
Bjørn Børresen
Greenhorn

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
 
GeeCON Prague 2014
 
subject: repaint() problem