Wednesday, 7 August 2013

How to see if a something in Graphics2D is off the frame

How to see if a something in Graphics2D is off the frame

I have a paint method that I have draw a rectangle and move it across the
screen and what I want it to do I when the rectangle goes off the screen
to move it back to the start of the JFrame. I assume it would be something
like if(rectangle.isoffthescreen){ put it back on the screen } but I don't
know how to do that. Also, I want to know if you can do something to the
rect like JFrame frame = new JFrame();, but for obviously for the
rectangle. I'm sorry if this is confusing.

No comments:

Post a Comment