Forum Stats

  • 3,769,824 Users
  • 2,253,026 Discussions
  • 7,875,217 Comments

Discussions

How to repaint in a frame?

843807
843807 Member Posts: 46,582
edited Oct 16, 2002 8:50AM in Java Desktop Applications
Hi,

I have drawn text in frame intially. There after I want to change the text often based on the mouse movements. I'm using mousemoved event to capture the event and inside of that, I'm invoking the repaint method. It's displaying the new text. But, the old one is not getting erased. I want to erase the old text and drew the new text.

Thanks,
Satya.

Comments

  • 843807
    843807 Member Posts: 46,582
    Then erase the old text!?

    I guess you have overridden the paint metod of the frame and using the Graphics.drawString method to draw the text? Then you need to clear the area with fillRect before drawing the text...
This discussion has been closed.