This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes There is a Line Object? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "There is a Line Object?" Watch "There is a Line Object?" New topic

There is a Line Object?

Julio Nardi

Joined: Oct 28, 2004
Posts: 1
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!

Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
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.
I agree. Here's the link:
subject: There is a Line Object?
It's not a secret anymore!