Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dnd using control key..urgent

 
Vinod Venugopal
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dnd?
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Drag n' Drop
 
eric moon
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
eric moon
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic