How to use setStroke() to draw a dotted line?

Can dc.setStroke() and dc.drawLine() be used to draw a dotted or dashed line somehow?  I need the line to be alternating transparent and white (or black) sections.  Not sure how or if this can be done.