title: How do I get the canvas size in a java applet from Graphics?
body: <p>The code that I have now gives me the size of the applet, not the size of the drawing area. How could I fix that?</p>
  
  <pre><code>public void paint(Graphics g) 
  { 
      g.setColor(new Color(255,255,255));
      g.fillRect(5, 5, getWidth()-5, getHeight()-5);
  
  }
  </code></pre>