Thursday, December 24, 2009

Can someone help with very basic java programming?

I know how to make object A move when it is clicked on and dragged. What I need to know is how to make Object B move both itself and A (relative to B) when it is clicked on and dragged?Can someone help with very basic java programming?
Assuming your visual objects are Swing components in the same JFrame, you could enable a MouseMotionListener when Object B is clicked-on. Then adjust Object A via Component.setLocation() per each MouseEvent detected with Object B drags.

No comments:

Post a Comment