Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
rohith yenumula
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't tried the code in the link, so let us know if it works

http://java-sl.com/connector.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic