nimbus-ios

JPanel gets paintComponent gets called when child is entered

与世无争的帅哥 提交于 2020-01-05 17:38:53
问题 Some previous entries here address paintComponent() being called repeatedly, but the answers hinged on paintComponent itself calling repaint(). Using Nimbus L&F, if I subclass JPanel and add a JButton or JTextField, then my JPanel's paintComponent() method gets called whenever I enter or leave a child. In addition, if the JTextField gets focus, my panel's paintComponent() method gets called for every flash of the text field's position cursor. My paintComponent() method does nothing other than

JPanel gets paintComponent gets called when child is entered

大城市里の小女人 提交于 2020-01-05 17:38:05
问题 Some previous entries here address paintComponent() being called repeatedly, but the answers hinged on paintComponent itself calling repaint(). Using Nimbus L&F, if I subclass JPanel and add a JButton or JTextField, then my JPanel's paintComponent() method gets called whenever I enter or leave a child. In addition, if the JTextField gets focus, my panel's paintComponent() method gets called for every flash of the text field's position cursor. My paintComponent() method does nothing other than