stroke = new BasicStroke(
               0.2f*ds,//width
               BasicStroke.CAP_SQUARE,
               BasicStroke.JOIN_BEVEL,
               0.0f,//miterlimit doesn't matter
               //Dash pattern
               new float[] {0.1f*ds,0.3f*ds},
               0.0f);//Dash phase
    g2.setStroke(stroke);
    GeneralPath gp4 = new GeneralPath();
    gp4.moveTo(0.25f*ds,1.25f*ds);
    gp4.lineTo(0.50f*ds,0.25f*ds);
    gp4.lineTo(0.75f*ds,1.25f*ds);
    g2.setPaint(Color.blue);
    g2.draw(gp4);

Figure 12