Refresh screen by repaint() mothed



Hi here,

In my cast.
class MyFrame extends JFrame{
public void paint(Graphics g){
g.drawText("some word");
}
}
Every time I call repaint() mothed. the application screen twinkled.
If i call repaint() frequently. the screen continuously fresh. It's
serious problem for user experience.
how can I avoid this problem?

I appreciate to any suggestion!

liang xiao
.



Relevant Pages

  • Re: Refresh screen by repaint() mothed
    ... class MyFrame extends JFrame{ ... Every time I call repaint() mothed. ... Daniel Pitts' Tech Blog: ...
    (comp.lang.java.gui)
  • Re: Refresh screen by repaint() mothed
    ... class MyFrame extends JFrame{ ... public void paint{ ... Every time I call repaint() mothed. ... Don't override paint. ...
    (comp.lang.java.gui)
  • Re: whats wrong in this program
    ... > class MyFrame extends JFrame ... > public void MyFrame() ...
    (comp.lang.java.programmer)
  • Re: Creating BufferedImage -- second question
    ... Graphics context, and I ran right into your gotcha -- the ... is with the way Swing optimizes repaint calls. ... public void processImage{ ... which says that while an event is being handled, no painting will ...
    (comp.lang.java.programmer)
  • Re: Creating a "movie" in Swing.
    ... public void paint{ ... If you think it can then there are some things you can do to prevent the write coalescing with repaint(). ... If you are drawing the whole component or redrawing the complete background I would suggest that you NOT call super.paintComponent. ... It invokes the listener on the EDT and degrades gracefully by coalescing if you overrun the interval on a slower machine. ...
    (comp.lang.java.programmer)