Calling repaint() on any Component will add a request to the repaint dispatcher to draw this component. If the conditions are correct, the manager then organizes a call to the Component paint(...) method. Since the Paint Component method will call paintComponent(...) , paintBorder(...) and paintChildren(...) , this will have the component paint, its border and cascading picture recursively for all of its children, their children, their children - children etc. Calling this on a JFrame will cause this cascade throughout the top-level window, while calling it on a subcomponent will cause the component to be redrawn and its children.
Note that calling repaint() does not guarantee that the redraw manager will draw the component, especially if there are complex requests. For more details, see Painting in AWT and Swing .
Hovercraft full of eels
source share