How does repaint work?
If I have a Component inside a JPanel, inside a JFrame and I call repaint on the Component, does that also repaint all other Components in the entire JFrame and JPanel, or does it just repaint that single Component that I called repaint on?
# 1
repaint asks java to have the GUI thread repaint just the component you repainted on.In a JFrame, the way that paint is implemented, paint will also paint all of its child components.