• Post Reply Bookmark Topic Watch Topic
  • New Topic

java.awt stroke  RSS feed

 
Adam J Smith
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an application that uses BasicStroke to draw lines. I would like for the lines to get wider as they get longer (like a long triangle). What would be the easiest way to accomplish this.
 
Campbell Ritchie
Sheriff
Posts: 53779
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doesn't sound easy.

I don't think you can do it with the Stroke itself. You might try two Strokes which converge/diverge slightly.
Or a Polygon; you start with one corner and then get two corners at the other end. You would probably need a MouseListener for the position of the mouse at the two ends.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!