public static void drawWave(Component c, Graphics g, int x, String text) {
    int y = getTextBaseLine(c);

    y += 2;

    int width = c.getFontMetrics(c.getFont()).stringWidth(text);
    int nLines = (width >> 1) + 1;

    int xCurr = x;
    int yBottom = y + 1;
    int []xx = new int[nLines + 1];
    int []yy = new int[nLines + 1];
    int line = 0;
    for (; line < nLines; line += 2) {
      xx[line] = xCurr;
      yy[line] = yBottom;

      xx[line + 1] = xCurr + 2;
      yy[line + 1] = yBottom - 2;
      xCurr += 4;
    }

    g.drawPolyline(xx, yy, line);
  }
public static void drawWave(Component c, Graphics g, int x, String text)