• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

There is a Line Object?

 
Julio Nardi
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!
I am working in a modeling tool and I need to implement a association between two elements. I tried to use the method "drawLine" from Graphics class, but it does not work as I would like. The line constructed is only many pixels drew.
I would like to have a object to draw the line, that I can move it and treat its events.

If someone knows something about it, please, send a help.

Thanks,very much!

Julio.
 
Craig Wood
Ranch Hand
Posts: 1535
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The java.awt.geom package has the abstract class Line2D which implements the Shape interface and contains the nested classes Line2D.Double and Line2D.Float. These classes and interface have methods for working with lines.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic