This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hello All, I want to know if its possible to implement dnd using the Control key, like how its implemented in Windows systems, i.e, I press the Control Key & then start dnd..& is there any sample code ? Vinod
The getDragAction method of DragGestureEvent is supposed to return ACTION_COPY, ACTION_LINK, or ACTION_MOVE based on the state of the control and shift modifier keys. The action is actually determined in the DragGestureRecognizer. On windows and unix, ctrl gives ACTION_COPY, and ctrl-shift gives ACTION_LINK. I haven't tried any of this yet. I'm just now reading the DnD chapter in Core Advanced Swing..... Not much help, I know. Let me know if you get it to work!
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>"Those who cast the votes decide nothing. Those who count the<BR>votes decide<BR>everything." <BR> -Joseph Stalin<HR></BLOCKQUOTE>
Joined: Nov 26, 2000
Here's some more: The acceptDrag method of DropTarget takes an int dragOperation. A decision is made what to do with that value in the body of the method. You could subclass DropTarget if you have something different in mind, other than copying or moving..... e