> [url
> http://java.sun.com/docs/books/tutorial/uiswing/misc/d
> nd.html]How to Use Drag and Drop[/url].
Thanks for this link. In fact I've read it before posting my question here. Unfortunately there is no mentioning about dialogs :(
And [url http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html]How to Make Dialogs[/url] is not helpful for this issue also.
> Open up two versions of the same application and try
> dragging between the two of them.
I understand this. Also possible solution is to replace JDialog with another JFrame. Then there will be DnD from one JFrame to another JFrame. The problem is that DnD source is JDialog, modal one... :(
I've not tried this - it seems an odd requirement, and to be honest I'd need convincing that there exists a scenario where it's appropriate to have modality and the ability to drag between frames, I'd instictively think they'd be mutually exclusive - but, pondering a workaorund, you could try something along the lines of the following.
You could try coding a 'fake' DnD implementation, ie handle the mouse events and change the cursor manually. When you get a release event after a drag, you determine the location of that event on the screen (ie add together MouseEvent.getPoint() and Component.getLocationOnScreen()). From that you should be able to access the component in the target frame (using Component.getComponentAt() - a Window is a Component of course).
I dunno - maybe that wouldn't work, I'd need to play around with it. But I reckon it's doable. Just a thought.