FontRenderContext frc = g2.getFontRenderContext();
Font font = g2.getFont();
g2.setColor(Color.black);
for (int i=0; i < 3; i++) {
g2.setStroke(new BasicStroke(15, cap[i], BasicStroke.JOIN_MITER));
g2.draw(new Line2D.Float(w/4,(i+1)*h/4,w-w/4,(i+1)*h/4));
TextLayout tl = new TextLayout(desc[i], font, frc);
tl.draw(g2,(float)(w/2-tl.getBounds().getWidth()/2),(i+1)*h/4-10);
}