?
Solved

change drag sensitivity (java doc included)

Posted on 2006-03-23
8
Medium Priority
?
695 Views
Last Modified: 2008-02-20

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

0
Comment
Question by:iAwin
  • 4
  • 4
8 Comments
 
LVL 14

Expert Comment

by:StillUnAware
ID: 16271259
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
 

Author Comment

by:iAwin
ID: 16271344

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

But does'nt work for me
0
 
LVL 14

Accepted Solution

by:
StillUnAware earned 500 total points
ID: 16271590
it should be "awt.dnd.drag.threshold".

another option would be this:

Toolkit.getDefaultToolkit().setDesktopProperty("DnD.gestureMotionThreshold");
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:iAwin
ID: 16271616
"awt.dnd.drag.threshold" works

Thanks very much
0
 

Author Comment

by:iAwin
ID: 16271643

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

Is'nt it the same really?
0
 
LVL 14

Expert Comment

by:StillUnAware
ID: 16271644
glad to help
0
 
LVL 14

Expert Comment

by:StillUnAware
ID: 16271664
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
 

Author Comment

by:iAwin
ID: 16278526

thanks again
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month16 days, 23 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question