Not enough that you opened thread that is 4 years old, you did not bother to read forum rules (hijacking thread, no emails in the post) you also did not even consider to read sticky thread "We only give homework help to those who show effort". On top of all you did not explain where you have difficulties with paint() method and you did not provide single line of code.
Consider all that and act upon it...
plz gve me codes of java paint