0 Replies Latest reply: Apr 18, 2013 11:56 PM by 1004052 RSS

    Drawing out of bounds, try catch when a shape goes out of the JFrame bounds

      I have a homework that wants this program:

      Demonstrate the use of exception handling to catch errors including divide by zero and drawing out of bounds.
      the program allows the user to enter 3 points, which the program uses to draw a triangle. Then, allow the user to input a value and use this to scale the triangle larger or smaller from the geographic center of the JFrame. Make sure you handle the case when a zero is entered as the scale. Make sure you handle the case when the triangle points go outside the JFrame (throw an exception!!!).

      I can draw the triangle, but i dont have an idea how catch the triangle is out of bounds of the JFrame.

      Is there any method, or class, or what can i do?

      Edited by: 1001049 on Apr 18, 2013 9:55 PM