The Artima Developer Community
Sponsored Link

Java Answers Forum
Dashed line in java graphics

2 replies on 1 page. Most recent reply: Mar 26, 2003 3:25 AM by Aladdin Mouhaimeed

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 2 replies on 1 page
Aladdin Mouhaimeed

Posts: 11
Nickname: aladdin11
Registered: Mar, 2003

Dashed line in java graphics Posted: Mar 22, 2003 8:51 AM
Reply to this message Reply
Advertisement
I want to draw a dashed line in Graphics2D, Can anybody help me.
After that is there any method that makes me draw just a point on the frame? Now I use drawLine(x,y,x,y), but I think there should be more specefic method!


Manish Sharma

Posts: 1
Nickname: manishs
Registered: Mar, 2003

Re: Dashed line in java graphics Posted: Mar 26, 2003 1:25 AM
Reply to this message Reply
Use the Stroke class to create lines with dashed patterns
The java.awt.BasicStroke class allows you to specify any dash pattern.

graphics.setStroke(new BasicStroke(.......));
graphics.drawLine(..... etc..

Aladdin Mouhaimeed

Posts: 11
Nickname: aladdin11
Registered: Mar, 2003

Re: Dashed line in java graphics Posted: Mar 26, 2003 3:25 AM
Reply to this message Reply
Thank you very much indeed.
I realy appriciate your help, and I got benefit of it.

Flat View: This topic has 2 replies on 1 page
Topic: large problem with int Previous Topic   Next Topic Topic: Huffman Tree

Sponsored Links



Google
  Web Artima.com   

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