[Solved] Rectangle.intersects

How does it work?

Because I made a class called Unit with a parent of Rectangle.
I’m trying to have it so that when you drag the mouse, it would create a
Rectangle, and I would test it to see if it intersects with Unit.

I did that, but for some reason, Java wouldn’t detect if the Unit intersects or not.
???

Could somebody help?

EDIT: I solved it.

Literally an infinite amount of things that could go wrong without you posting the code. ::slight_smile:

Yeah without code there isn’t much we can do to help.

Read up on the rectangle docs: http://docs.oracle.com/javase/1.5.0/docs/api/java/awt/Rectangle.html#intersects(java.awt.Rectangle)

OK.
Here’s the source code you’ve been asking for.
http://pastebin.com/dPtwZYf6