title: Graphics.clearRect() won't work for me
body: <p>Hi I've searched the web for a while but the solves I've encountered don't work for me. So here's my issue:</p>
  
  <p>I'm making some graphs on my GUI by using Graphics and drawLine(), which works perfectly fine for me - the first time. When I tell my program to redraw another graph on the same area it just messes things up.</p>
  
  <pre><code>    public void paintComponent(Graphics g) {
          super.paintComponent(g);
          int max = 100;
          g.clearRect(0, 0, 205, 200); &lt;-- 
  
          g.drawRect(10, 10, 200, 200);
          g.drawString(""+max, 0, 10);
          g.drawLine(5, 110, 10, 110);
          g.drawString("0", 0, 275);
  
          ...Drawing the actual graph here...
      }
  </code></pre>
  
  <p>Now the idea was that everytime I draw this I first lay out a white surface, so it removes anything drawn earlier. But it doesn't work.</p>
  
  <p>I'm quite new to Graphics so please don't hesitate to comment if I'm doing it completely wrong.</p>
  
  <p>Thanks in advance.</p>
  
  <p>-Alex</p>