title: acm.graphics APPLICATION_WIDTH and APPLICATION_HEIGHT constants not resizing window
body: <p>I am taking an iTunesU class that uses Eric S. Roberts' book <strong>"The Art and Science of Java"</strong>. The book claims that if I extend <code>GraphicsProgram</code> (part of the acm.program JAR) then I can simply declare constants named <code>APPLICATION_WIDTH</code> and <code>APPLICATION_HEIGHT</code> and give them values and <code>GraphicsProgram</code> will look to see if I've done that and resize the window accordingly. I can resize my window by adding:</p>
  
  <pre><code>setSize(APPLICATION_WIDTH, APPLICATION_HEIGHT +CITATION_MARGIN);
  </code></pre>
  
  <p>in my <code>run()</code> method but according to the book I shouldn't have to. Is the book lying to me or have I missed something? Heres the code:</p>
  
  <pre><code>/*
   * File: FryImage.java
   * -------------------
   * This program displays an image with a citation to the
   * graphics window.
   */
  
  
  package chap9;
  
  import acm.program.*;
  import acm.graphics.*;
  
  public class FryImage extends GraphicsProgram {
  // Citation constants
  private static final String CITATION_FONT = "SansSerif-10";
  private static final int CITATION_MARGIN = 30;
  
  // dimensions of window
  private static final int APPLICATION_WIDTH = 640;
  private static final int APPLICATION_HEIGHT = 640 + CITATION_MARGIN;
  
  public void run(){
      add(new GImage("ProfAlive.jpg"));
      addCitation("Courtesy of Reddit Weekly");
  }
  
  // Adds citation along bottom of window
  private void addCitation(String text) {
      GLabel label = new GLabel(text);
      label.setFont(CITATION_FONT);
          double x = (getWidth() - label.getWidth()) / 2;
      double y = getHeight() - CITATION_MARGIN + label.getAscent();
      add(label, x, y);
      }
  }
  </code></pre>
  
  <p>I saw questions similar to mine but none that addressed the ability to simply declare constants to resize the window.</p>