• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

dnd using control key..urgent

 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
dnd?
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Drag n' Drop
 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic