• Post Reply Bookmark Topic Watch Topic
  • New Topic

Frames  RSS feed

 
memati bas
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I could not exactly understand the usage and purpose of repaint() method in Frames ?
For example, I put an mouseclick event to my Frame object. And then I changed the background with this. But while doing this , I call repaint() without knowing its usage
 
Sunil Kumar Gupta
Ranch Hand
Posts: 824
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Try removing repaint() from your code and you will know the usage of it.


-------------------------------------------------------------------------

The purpose of the repaint method is to cause the screen area occupied by a component to be repainted as soon as possible. In your case, that causes the Frame's new color to appear on the screen.

Invoking the repaint method on a Frame sends a request to the operating system to invoke the Frames's paint method to repaint the Frame


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!