paint()
method! And yet the text gets drawn
on the screen anyhow. How does this happen?
Components know how to paint themselves. When a container like
an applet is repainted it not only calls its own
paint()
method, it calls the paint()
method for
all the components it contains.
java.awt.Label
has its own paint()
method which knows how to paint()
itself. The short of
it is that you don't need to worry about painting components unless
you create your own component classes or modify the appearance of
the system supplied components.