public void draw(Graphics graph,Rectangle clipBounds){
  graph.setColor(COLOR_BACKGROUND);
  graph.setFont(FONT_CHAT);
  int yOffset=((clipBounds.height) - height - DIST_BOTTOM) + slideOffset + clipBounds.y;
  graph.fillRect(DIST_SIDE + clipBounds.x,yOffset,width,height);
  graph.setColor(COLOR_TEXT_BACK);
  if (slideOffset == getMaxSlideOffset()) {
    graph.drawImage(maxbutton,10 + clipBounds.x,yOffset + 3,bv);
  }
 else {
    graph.drawImage(minbutton,10 + clipBounds.x,yOffset + 3,bv);
  }
  printLine(graph,"Incoming messages...",29 + clipBounds.x,yOffset + 15);
  graph.drawImage(resizebutton,(width - 16) + clipBounds.x,yOffset + 3,bv);
  graph.drawImage(upbutton,(width - 16) + clipBounds.x,yOffset + 16,bv);
  graph.drawRect((width - 16) + clipBounds.x,yOffset + 30,13,getScrollbarOuterHeight());
  graph.drawRect((width - 14) + clipBounds.x,yOffset + 31 + scrollBarOffset,9,scrollBarHeight);
  graph.drawImage(downbutton,(width - 16) + clipBounds.x,(yOffset + height) - 20,bv);
  graph.drawRect(10 + clipBounds.x,(yOffset + height) - 21,width - 50,17);
  if (message != null && bv.getChatterBoxActive()) {
    printLine(graph,visibleMessage + "_",13 + clipBounds.x,(yOffset + height) - 7);
  }
  int rows=messages.size();
  if (rows <= max_nbr_rows) {
    for (int i=0; i < messages.size(); i++) {
      printLine(graph,messages.elementAt(i),10 + clipBounds.x,yOffset + 15 + ((i + 1) * 15));
    }
  }
 else {
    int row=1;
    for (int i=rows - max_nbr_rows - chatScroll; i < (messages.size() - chatScroll); i++) {
      if (i > -1) {
        printLine(graph,messages.elementAt(i),10 + clipBounds.x,yOffset + 15 + (row * 15));
        row++;
      }
    }
  }
}

public void draw ( Graphics graph , Rectangle clipBounds ) { graph . setColor ( COLOR_BACKGROUND ) ; graph . setFont ( FONT_CHAT ) ; int yOffset = ( ( clipBounds . height ) - height - DIST_BOTTOM ) + slideOffset + clipBounds . y ; graph . fillRect ( DIST_SIDE + clipBounds . x , yOffset , width , height ) ; graph . setColor ( COLOR_TEXT_BACK ) ; if ( slideOffset == getMaxSlideOffset ( ) ) { graph . drawImage ( maxbutton , 10 + clipBounds . x , yOffset + 3 , bv ) ; } else { graph . drawImage ( minbutton , 10 + clipBounds . x , yOffset + 3 , bv ) ; } printLine ( graph , "Incoming messages..." , 29 + clipBounds . x , yOffset + 15 ) ; graph . drawImage ( resizebutton , ( width - 16 ) + clipBounds . x , yOffset + 3 , bv ) ; graph . drawImage ( upbutton , ( width - 16 ) + clipBounds . x , yOffset + 16 , bv ) ; graph . drawRect ( ( width - 16 ) + clipBounds . x , yOffset + 30 , 13 , getScrollbarOuterHeight ( ) ) ; graph . drawRect ( ( width - 14 ) + clipBounds . x , yOffset + 31 + scrollBarOffset , 9 , scrollBarHeight ) ; graph . drawImage ( downbutton , ( width - 16 ) + clipBounds . x , ( yOffset + height ) - 20 , bv ) ; graph . drawRect ( 10 + clipBounds . x , ( yOffset + height ) - 21 , width - 50 , 17 ) ; if ( message != null && bv . getChatterBoxActive ( ) ) { printLine ( graph , visibleMessage + "_" , 13 + clipBounds . x , ( yOffset + height ) - 7 ) ; } int rows = messages . size ( ) ; if ( rows <= max_nbr_rows ) { for ( int i = 0 ; i < messages . size ( ) ; i ++ ) { printLine ( graph , messages . elementAt ( i ) , 10 + clipBounds . x , yOffset + 15 + ( ( i + 1 ) * 15 ) ) ; } } else { int row = 1 ; for ( int i = rows - max_nbr_rows - chatScroll ; i < ( messages . size ( ) - chatScroll ) ; i ++ ) { if ( i > - 1 ) { printLine ( graph , messages . elementAt ( i ) , 10 + clipBounds . x , yOffset + 15 + ( row * 15 ) ) ; row ++ ; } } } }
draws the chatter box .
