Virtual Position Forum
Please register to watch content in detail
Thanks
Admin virtual position


Join the forum, it's quick and easy

Virtual Position Forum
Please register to watch content in detail
Thanks
Admin virtual position
Virtual Position Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

paintComponent in java 2011

View previous topic View next topic Go down

GMT + 3 Hours paintComponent in java 2011

Post by sharmila farooqi Sun May 29, 2011 5:23 pm

Respected Sir A.A,
in the Example code 18.1, while overriding the paintComponent method of the myPanel class, you call the parent paintComponent method (super.paintComponent), i didn't understand this that why u did this????????
avatar
sharmila farooqi
Monstars
Monstars

Posts : 35
Join date : 2011-05-29

Back to top Go down

GMT + 3 Hours Re: paintComponent in java 2011

Post by Vuhelper Sun May 29, 2011 5:24 pm

We use super.paintComponent(g) to clear the background of our panel. As there is nothing in the paintComponent() method of the parent class. So to make the background blank we will call the method of parent class, which will draw blank or simply clear every thing.



We are using super so that paintComponent() of parent class is called.
avatar
Vuhelper
Deep Bench
Deep Bench

Posts : 97
Join date : 2011-05-29

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum