paint() is the method that gets called to render graphics objects into the GUI. Each visual component will have a paint() method implemented that draws whatever items are required to make itself visible. So a background component would draw the application background, the button components would each draw their associated buttons, and so on for the labels and text input controls, and so forth. Including any custom components you may have defined. Parent components ensure that their children get painted when the parent is repainted, which they may do explicitly, or in some cases, because the master paint method simply runs through all affected components in turn.
For performance reasons, paint requests are often placed on a queue and executed by an independent painting
thread. The primary GUI thread usually caused these requests to be queued by calling some sort of invalidate() or repaint() method to indicate that an update (paint) is needed. In the case of complex desktops, moving other applications over the current application's display (or removing them from overlaying the current app) can also cause the app's GUI framework to queue up paint requests.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.