Make revolute joints move with bodies?

OK, i got revolute joints working so that u can click on bodies and place a joint, but the problem now is that i want the joints to move with the bodies rather than 'pin' the bodies still.
What i want to be able to do is:

Create a shape(box)
Click on that box to add revolute joint
Place another shape over that joint so it pivots.

Any help would be greatly apprieciated. Thanks 😀

Original thread: https://box2d.org/forum/viewtopic.php?t=724