This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Changing cursor while dragging Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Changing cursor while dragging" Watch "Changing cursor while dragging" New topic
Author

Changing cursor while dragging

amol l a lekurwale
Ranch Hand

Joined: Oct 16, 2008
Posts: 30
Please let me know if this is the right thread to post this topic.

I have a JSP displaying a image with a button to allow measurement between two points. The cursor needs to be clicked on one point and dragged to the other. While dragging, the cursor changes to the one of windows ( cirlce with cross black line ). Can anyone suggest me a way so that the cursor remains to same while dragging as it was prior to start of drag.
Kamala Miller
Greenhorn

Joined: Jun 13, 2005
Posts: 4
You can use CSS to change the cursor (cursor:crosshair is the one it sounds like you want). I'm not sure off the top of my head if you can add an :active style to the image or if you'll need to use JavaScript onmousedown to activate the style change.

Hope that helps!
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15361
    
    6
Set the css: http://www.echoecho.com/csscursors.htm

Eric
amol l a lekurwale
Ranch Hand

Joined: Oct 16, 2008
Posts: 30
Eric,
Thanks for your response. I have a measurement tools, which has its cursor set programatically. The problem I am facing is that when I click on the measurement tool, I get to see that cursor. But when I click and drag for measurement between two points, it changes to cross hair, which I want to keep same as that of the preset cursor.
amol l a lekurwale
Ranch Hand

Joined: Oct 16, 2008
Posts: 30
Any updates for the changing cursor at the dragging event?
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Changing cursor while dragging
 
Similar Threads
Change cursor type in DnD tree
Dragging a JWindow
Openhand (drag) cursor
Drag and Drop between JFrames freezes
popup window moving