Using variable for x, y coordinates in GRect? (Java newbie)
<p>I'm just learning Java, and I am working with a GRect object.  I'm trying to assign the x and y coordinates to an int, but not having luck.  I'm not sure what I'm missing?</p>

<p>Specifically, I'm looking at the getHeight():</p>

<p>Basically, I've got</p>

<pre><code>add(new GRect(moveRight,getHeight(), BRICK_WIDTH, BRICK_HEIGHT));
</code></pre>

<p>That is working fine, but I assigned getHeight to an int, and then it doesn't work:</p>

<pre><code>int displayHeight = getHeight();    

add(new GRect(moveRight,displayHeight,BRICK_WIDTH,BRICK_HEIGHT));
</code></pre>

<p>Any ideas?</p>

<p>To clarify-from what I have gathered from these online classes, getHeight() will return the height of the graphics window if it isn't assigned to a class.</p>

<p>With the above, I'm trying to get the GRect to start at the bottom of the graphics window...as I said, when having the first example above, the rectangles move correctly, in the second example, they remain at the top of the display.</p>

<p>Thanks!
Joel</p>
