Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 1 year ago. Improve this question I am trying to print shapes in a loop, but when I run
Tag: repaint
Why using an if statement inside a paintComponent(Graphics g) method invalidates all code inside the method?
I’m trying to create a JFrame object which contains a JPanel object. Inside the JPanel object there are 3 JButtons that when clicked, are intended to change the background color of the JPanel. I also want to draw an image which size equals the one of the JPanel object to give the impression of a background image but as you
Java AWT Window doesn’t get repainted
I’ve derived a class from window, but whenever I call setValue() (which calls repaint) it doesn’t get redrawn (the method is called, but nothing changes on the screen). The first value is drawn, which is 0 by default. Here’s the class: Why does it not get repainted properly? Answer From the oracle docs If [the update] method is reimplemented, super.update(g)