Why does calling dispose() on Graphics object cause JPanel to not render any components
After learning that dispose() should be called on Graphics / Graphics2D object after use, I went about changing my game to incorporate this. When I added g2d.dispose() in overridden paintComponent(Graphics g) of JPanel , my components which I added (extensions of JLabel class) where not rendered I was able to still click on them etc but they would not be painted . I tested with a normal JLabel and JButton with same effect (though JButton is rendered when mouse is over it). So my question is why does this happen? Here is an SSCCE to demonstrate: after uncommenting call to dispose() in