• Post Reply Bookmark Topic Watch Topic
  • New Topic

applet flicker upon netscape wndw resize  RSS feed

 
Steve Johnson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What causes an applet to flicker when the Netscape window
which contains the applet is resized ?
I don't think we are mixing any heavyweight and lightweight components.
We are using a JApplet with JDK 1.2 on Windows 95/NT.
 
paul wheaton
Trailboss
Posts: 22574
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Flicker during the resize or after the resize?
During makes sense: the applet repaint() is called repeatedly because the image may have been obscured.
 
sai
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use this method to avoid flickering
public void update(Graphics g)
{
paint(g);
}
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i found that i was using a lot of System.out.println(""); statements in my paint method as such this was slowing things down. The rule i found is
"NEVER HAVE system.out.println() STATEMENTS IN U R PAINT CODE".
another rule i follow is first undertake repaint() and then do the processing of the data.
for example if i have to display "abc" on the applet. i first display "abc" by calling repaint in another method and then save the data rather than saving the data first and then repainting.
Rahul
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!