Problems with Paint
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Raju_Rudraraju
Posted On:   Wednesday, August 22, 2001 01:25 PM

I am developing a Java application using Personal Java API which is roughly equivalent to JDK 1.1.6 I have a frame and couple of panels with some components on them. Based on user's actions I am replacing an panel on the frame with another one. None has any complex components involved. Now when I replace a Panel and call update() on the frame, I still see some gibberish from the old panel. I tried many combinations of paint() repaint() validate() update() etc. But none seems to work. It looks like the new panel is behaving as though it is non-opaque. Is there a way of showing a clean screen with new panel? I am constrined to using simple AWT only. I read nearly all forum questions on pa   More>>


I am developing a Java application using Personal Java API which is roughly equivalent to JDK 1.1.6



I have a frame and couple of panels with some components on them. Based on user's actions I am replacing an panel on the frame with another one. None has any complex components involved. Now when I replace a Panel and call update() on the frame, I still see some gibberish from the old panel.



I tried many combinations of paint() repaint() validate() update() etc. But none seems to work. It looks like the new panel is behaving as though it is non-opaque.



Is there a way of showing a clean screen with new panel? I am constrined to using simple AWT only. I read nearly all forum questions on paint. And tried many of them, but they didn't solve my problem. BTW. If I run the same program using JDK 1.2.1 and higher, it works perfectly fine. I guess I need to somehow force the AWT thread to paint all components incl. Frame and/or make the panel as opaque.




Any hints are greatly appreciated


thanks


Raju

   <<Less

Re: Problems with Paint

Posted By:   Raju_Rudraraju  
Posted On:   Thursday, August 23, 2001 01:52 PM


Well, This problem is solved. I have a thread running in one of the panel and it has wait state to support some functionality.



While that particular thread is waiting, the Personal Java JVM halted the AWT thread too... Frankly I don't know why. I removed that thread and changed the implementation to listeners to get the desired functionality.



It is working better now. I only said better... If I am doing some heavy processing after issuing an update or paint call, these are getting executed only when the processor is relatively free. I ses this more as a JVM issue than an application programming issue.



I am still looking for ways to force system to paint whenever I want. I appreciate if somebody can share their views on this.



Thanks



Raju
About | Sitemap | Contact