protected void paintComponent(Graphics g){
  backgroundPainter.paint(g,getVisibleRect());
  TextUI ui=getUI();
  if (ui != null) {
    Graphics scratchGraphics=g.create();
    try {
      ui.update(scratchGraphics,this);
    }
  finally {
      scratchGraphics.dispose();
    }
  }
}

protected void paintComponent ( Graphics g ) { backgroundPainter . paint ( g , getVisibleRect ( ) ) ; TextUI ui = getUI ( ) ; if ( ui != null ) { Graphics scratchGraphics = g . create ( ) ; try { ui . update ( scratchGraphics , this ) ; } finally { scratchGraphics . dispose ( ) ; } } }
paints the text area .
