aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Drawing a line by dragging the mouse from one point to another Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Drawing a line by dragging the mouse from one point to another" Watch "Drawing a line by dragging the mouse from one point to another" New topic
Author

Drawing a line by dragging the mouse from one point to another

rohith yenumula
Greenhorn

Joined: Dec 25, 2009
Posts: 14
I am trying to develop a gui in which the user can draw a line between two labels. I want it to be such a way that by dragging the mouse pointer from one label to another, a line
is drawn. And if the user drags the pointer from a label to any other point, then the line should not be drawn.

Any help would be highly appreciated
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
is this any different to your last post?

http://www.coderanch.com/t/487961/Swing-AWT-SWT-JFace/java/Displaying-image-TextArea

if it's the same, why not just continue that one, so others don't duplicate what has already been posted
rohith yenumula
Greenhorn

Joined: Dec 25, 2009
Posts: 14
In that post the emphasis was on displaying an image and a part of it was drawing lines between the two icons. Since I didn't get a favourable response I thought it would be better to start a new topic.

Sorry
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
I haven't tried the code in the link, so let us know if it works

http://java-sl.com/connector.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Drawing a line by dragging the mouse from one point to another