Mahdi_Nine
Mahdi_Nine

Reputation: 14761

what is different between paintcomponent() and paintcomponents()?

I want to know what is different between paintcomponent() and paintcomponents()?

when i use from paintcomponent it shows every thing that we want,but paintcomponents didn't do any thing!

Upvotes: 4

Views: 1066

Answers (1)

David Ly
David Ly

Reputation: 31606

From a quick browser of the source of java.awt.Container.paintComponents it seems like it (indirectly) calls paint (after some other processing) on it's child components, and the only reason you'd override it is if you want to do something funky with it. Generally unless you really know what you're doing you probably shouldn't override it and instead should just override paintComponent on the appropriate control.

Upvotes: 2

Related Questions