You got it. Calculate the offset between the object origin and the clicked position, then maintain the offset as you set the position during dragging. If you don't do this, you'll see that initial "jump" as it is sets the object's origin at the clicked mouse position (that is unless you happen to grab the object at its origin).
I normally do something like this when the object is "grabbed". This is calculated once, say for example in your mousePressed()
method:
Point origin = thing.getPosition();
scene.grabbedOffsetX = (mousePos.x - origin.x);
scene.grabbedOffsetY = (mousePos.y - origin.y);
Then when you redraw during the dragging operation you factor in the previously calculated offset. The offset remains constant throughout the dragging operation. This would be for example in your mouseDragged()
method:
thing.setPosition(mousePos.x - grabbedOffsetX, mousePos.y - grabbedOffsetY);
repaint();