drawLine(0, g, rect.x, rect.y);
Document document = textComponent.getDocument(); Element root = document.getDefaultRootElement(); int y = rect.y;  for (int i = 0; i < root.getElementCount(); i++) { drawLine(i, g, rect.x, y); y += metrics.getHeight(); }
  public void paint(Graphics g, Shape s)  {    JTextComponent textComponent = (JTextComponent) getContainer();        g.setFont(textComponent.getFont());    selectedColor = textComponent.getSelectedTextColor();    unselectedColor = textComponent.getForeground();    Rectangle rect = s.getBounds();        // FIXME: Text may be scrolled.    drawLine(0, g, rect.x, rect.y);  }