views:

32

answers:

2

Hi there,

Is it possible for a class implementing DropTargetListener, to detect whether the stuff being dragged comes from the same process of from elsewere?

+1  A: 

If you check the DataFlavor of the drop event, you can look to see if it contains a DataFlavor of javaJVMLocalObjectMimeType. As long as your app always provides that DataFlavor, then you'll know the source of the event was your app.

If that doesn't work for you, you could create a marker mime type and DataFlavor that your app can attach to any of it's drag sources.

Kevin Day
A: 

In general no. Marker DataFlavor is possible. In general, in DnD there is no need to know if I'm in or out. If I can convert data into way I can handle, then it is OK. Else I'm not interested.

Rastislav Komara