Let's say that I'm creating an application that enables drag and drop from one JPanel to another JPanel. That's easy to do and is explained in the Sun tutorial
. Now, here's the twist.
During the drag process, the component I am dragging is drawn as you drag it along
, as opposed to the boring default rectangle. This is crucial for usability.
I can think of one way to do this that involves the glass pane, but I'm wondering if anyone here knows the preferred way of doing this?
My solution would involve using a custom JComponent as the glasspane, writing my own custom mouse handling routines and then also doing the custom drawing. Sounds a bit overkill for this though...