Ad Code

DIRECTLY PAINTCOMPONENT () METHOD NOT RECOMMENDED WHY?


WHY IS DIRECTLY PAINTCOMPONENT () METHOD NOT RECOMMENDED?

Painting is managed by system, so calling paintComponent() directly is not recommended at all. Similarly calling paint( ) method is also not recommended. Why? Because such code may be invoked at times when it is not appropriate to paint -- for instance, before the component is visible or has access to a valid Graphics object.
Reactions

Post a Comment

0 Comments