tags:

views:

439

answers:

2

Hey

I have to draw a dotted or dashed line In a JComponent. How do I do that?

+3  A: 

Drawing Dashed Lines with Stroke

TStamper
+1  A: 

Get a hold of a Graphics2D, and use its setStroke() method to set a suitable stroke. It should be enough with a BasicStroke to get a dotted line, nothing fancy.

unwind