Rectangle r = a instanceof Rectangle ? (Rectangle) a : a.getBounds(); tabBase = r.x;
  public void paint(Graphics g, Shape a)  {    JTextComponent comp = (JTextComponent)getContainer();    // Ensure metrics are up-to-date.    updateMetrics();        selectionStart = comp.getSelectionStart();    selectionEnd = comp.getSelectionEnd();    selectedColor = comp.getSelectedTextColor();    unselectedColor = comp.getForeground();    disabledColor = comp.getDisabledTextColor();    selectedColor = comp.getSelectedTextColor();    lineHeight = metrics.getHeight();    g.setFont(comp.getFont());    super.paint(g, a);  }