Why is paintComponent() continuously and asynchronously being called without explicit repaint() call?
问题 So this question has two parts, which I think may be related, and it's mostly abstract. Briefly, here's what I'm doing: I have a JFrame with a JPanel and some child JPanels each with 3 JButtons on it. I also created a JComponent called glassPanel for the JFrame (i.e. myJFrame.setGlassPane(glassPanel) ), that allows me to paint over the JPanels and buttons. (1) Essentially triggered by clicking all 3 buttons on a JPanel , glassPanel is set to Visible (which appears to then call paintComponent(