user38725
user38725

Reputation: 903

JavaFX external Drag & Drop distinguish copy and move

I have a JavaFX application that implements drag & drop behavior to and from external applications working with one exception.

If I drag a file, say from desktop on Windows, into my application while holding control-key down (copy operation instead of move), I do not know how to detect that it is indeed a copy operation and not move operation.

I can check the control key when dragging out from the application, but this does not seem to work vice versa.

Any ideas?

Upvotes: 0

Views: 196

Answers (1)

user38725
user38725

Reputation: 903

DragEvent has a getAcceptedTransferMode()-method that does the trick.

Upvotes: 1

Related Questions