HanRui
asked on
Why super.paint(g)?
I have a JApplet with a paint method drawing a string. I construct and add a JLabel to the content pane. I understand the directions to use super.paint(g), and I see what happens when I leave it out (no label). But for the life of me I don't understand what is happening with the call to the Applet's (the superclass) paint method, sending up the graphics context.
The superclass is responsible for painting the applet child components (ie. your label), so if you don't call super.paint() the labels paint() method will not get called.
ASKER
There must be something going on behind the scenes because the paint method in the superclass is empty and overridden. That's my problem. The paint method that paints the label in the superclass is somehow hidden. Isn't that true?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.