stroke = new BasicStroke(
            0.1f*ds,//width
            BasicStroke.CAP_BUTT,
            BasicStroke.JOIN_ROUND,//don't care
            0.0f,//miterlimit doesn't matter
            //Dash pattern
            newfloat[] {0.2f*ds,0.1f*ds},
            0.0f);//Dash phase
    g2.setStroke(stroke);
     
    Ellipse2D.Double theCircle = 
              new Ellipse2D.Double(
                  -0.4*ds,-0.4*ds,0.8*ds,0.8*ds);
     
    g2.setPaint(Color.orange);
    g2.draw(theCircle);

Figure 15