The Artima Developer Community
Sponsored Link

Java Answers Forum
Dashed line suddenly became solid line!

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Z L

Posts: 2
Nickname: vitamin
Registered: Oct, 2006

Dashed line suddenly became solid line! Posted: Oct 26, 2006 11:43 PM
Reply to this message Reply
Advertisement
Hi,

Can anyone help me with a problem that I'm facing now?

I managed to draw a dashed line between two rotating objects. However, I noticed that at certain rotating angle, the dashed line become a solid line!

Below is my code:

Graphics2D g2d = (Graphics2D)g;
Line2D line = new Line2D.Double(x1, y1, x2, y2);
float[] dashPattern = {8,18};
g2d.setStroke(new BasicStroke(1.0F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1.0F, dashPattern, 0));
g2d.draw(line);

Thank you.

Topic: java.awt.Graphics Previous Topic   Next Topic Topic: NEED HELP ON CODE

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use