When you drag a block of text from a Word document into a Java text component, the text is removed from the Word document. This is obviously undesirable in some cases. Is there a way I can prevent Word from removing the text, while still copying it into the Java text component?
Try holding down ALT, CTL, or SHIFT (I forget) while dragging. I believe this changes the default behavior of your cursor from cut -> copy.
You may be able to set the default Drop action in your JText component to only allow copy, I know you can do that in SWT.
I think that is the default behavior (This would happen even if you drag the text from one Word document to another one). You may want to keep the 'Ctrl' key pressed to achieve the desired results (Ctrl + Drag forces a copy operation).
Can't you make use of copy/paste? Highlighting and dragging anything around in a Word document or out of a word document into another document or text area is the equivalent of cutting and pasting. Ctrl + C (copy) and Ctrl + V (paste) works just as fast.
Return false
from TransferHandler.importData(JComponent comp,Transferable t)
. You can keep the data but you tell the drag system that you didn't take it.