change drag sensitivity (java doc included)


Hi all,

The the following is taken from
:http://java.sun.com/j2se/1.5.0/docs/guide/awt/1.5/index.html

4415175: New API to Globally Change the DnD Gesture Motion Threshold
    The drag motion gesture threshold represents the number of pixels the cursor is dragged before the data transfer system initiates a drag operation. Prior to this release, this was hard-coded to 5 pixels. As of release 5.0, there is support for picking up the desktop properties for drag sensitivity and mapping it to the threshold, and new API that allows users to get and change this threshold. The new API includes:
        * java.awt.dnd.DragSource.getDragThreshold()
        * java.awt.dnd.drag.threshold (a property)
        * java.awt.dnd.MouseDragGestureRecognizer (updated class spec)

How can I change the drag sensitivity? Im unsure how to implement the above.

Thanks

iAwinAsked:
Who is Participating?
 
StillUnAwareCommented:
it should be "awt.dnd.drag.threshold".

another option would be this:

Toolkit.getDefaultToolkit().setDesktopProperty("DnD.gestureMotionThreshold");
0
 
StillUnAwareCommented:
As in DragSource.getDragThreshold() is said, You can set the system property "wt.dnd.drag.threshold" to some pixel count:

System.setProperty("wt.dnd.drag.threshold", "10");
0
 
iAwinAuthor Commented:

Thanks I tried this:
     System.setProperty("java.awt.dnd.drag.threshold", "10");

But does'nt work for me
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
iAwinAuthor Commented:
"awt.dnd.drag.threshold" works

Thanks very much
0
 
iAwinAuthor Commented:

Why did'nt "java.awt.dnd.drag.threshold" work?

Is'nt it the same really?
0
 
StillUnAwareCommented:
glad to help
0
 
StillUnAwareCommented:
I guess not, and it shouldn't. As two strings "java.awt.dnd.drag.threshold", "awt.dnd.drag.threshold" are different, the property names also are different or meaningless
0
 
iAwinAuthor Commented:

thanks again
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.