tags:

views:

246

answers:

3

I have a java applet built using awt.

I draw some text on a panel object and everything goes fine. but when resizing the windows all the text disappears.

this behaviour is different among different jvms and platforms.

moving to swing isn't a possible option, because we have to maintain compatiblty with Microsoft JVM.

A: 

You must override update(Graphics g) and render your text in there. This method will be called when the window needs to be redrawn.

Aaron Digulla
+1  A: 

Without seeing your code, we have to guess, but is it possible that your text drawing is not being done in a paint() method? Read this for details on how AWT painting works.

Michael Borgwardt
A: 

the applet works fine in jre1.6 but I have to keep it compatible with older JREs.

Bassel Alkhateeb