If you're using
JPanel, then the technology I was asking about would be Swing.
If you're using Swing, then you can use the various
java.awt.Shape subtypes to represent your geometry. For instance, you could represent your stars with
java.awt.Polygon.
When you want to do collision detection, construct a
java.awt.geom.Area out of your shapes,
intersect() them, and see if the resulting area
isEmpty().
The upside of this approach is that besides performing collision detection, you can also directly render shapes on your panel.
[edit]
Dave Tolls wrote:Java by itself doesn't have that sort of collision detection.
Untrue. Check out
java.awt.geom.Area.intersect().