• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet does'nt refresh itself???

 
michael page
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While using the latest version of internet explorer all my applets including the one in the round up moch exam don't refresh themselves when the browser is iconified then re-displayed, or when another window is past over the applet. How can I get round this problem??
(I can detect when my applet loses or gains focus by using a lisener, but I can't find away to let my applet Know when it has been hidden).
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This forum is about JavaRanch. You need to ask this in the Applet forum. I'm moving this there.
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The most likely mistake if you're new to Java GUI programming is trying to do your drawing in mainline code. I'll assume this because as far as I know, there aren't any IE versions that are broken in the way you say.
Java GUI programs should implement a paint() method which is where you usually want do do this kind of stuff. paint() gets called every time the program suspects that all or part of the display area has been damaged - you don't need to add listener code. paint() also can be called whenever you've made a change that requires a graphical update. This isn't done directly, but by calling repaint(), which will set up the graphics environment and call paint().
 
michael page
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
I've got it to refresh.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic