Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Dissapearing Drawings????  RSS feed

 
Cem Kozinoglu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi;
Why things drawn by
g.drawetc....(); (drawOval,Line ...)
is dissaperaing when I minimize my browser and maximize it again...
Is there any way to solve this problem? I see some applets which dont have the same problem? But I couldnt find the trick which makes the difference.....
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you resize the browser the area of the applet gets redrawn by a call by the JVM to update which clears the area and calls paint which redraws the entire applet (simplified version)
That is why just drawing directly to the applet outside of paint does not get preserved.
I think the tutorial at java.sun.com would help you.
 
Cem Kozinoglu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you are saying that Creating an component (extends Jpanel etc..) putting it into the applet and drawing anything inside the component by probably paintComponent will solve the problem??
Thank you for your help
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!