Date: Wed, 09 Apr 2003 16:26:07 -0500 (CDT) From: Mark Jacobson To: 810-061-02@uni.edu Subject: Thursday Boxball program.... Hi 061 Java students, The Boxball project. A FilledOval has a getX() method that returns you the Methods Available for All 2-D Graphic Objects (including Text, but not Line) someObject.getX(); someObject.getY(); someObject.getLocation(); Access coordinates of the upper left corner of an object's bounding rectangle. someObject.getWidth(); someObject.getHeight(); Access the dimensions of an object's bounding rectangle. It does NOT matter if the Ball class uses a FilledOval. The left edge and the top edge of the bounding rectangle are what the .getX() and the .getY() methods return. I have heard that the lab TA might have been telling you different. Something about the middle of the FilledOval????????? WRONG... ------ ----- .getX() tells you where the left edge of a Box's PIV FilledRect is or where the leftmost point of the FilledOval of a Ball is... .getX() + .getWidth() would tell where the right edge of a ball or of a box is, if you are using FilledOval and FilledRect PIVs to implement the actual Ball object and Box objects. Of course, for the ball .getX() + BALLWIDTH would also work, if you have a constant for the ball diameter value named BALLWIDTH. Mark