private void drawBubble(final Graphics2D g2d,final Color fillColor,final Color outLineColor,final int width,final int height){
  g2d.setColor(outLineColor);
  g2d.fillRoundRect(BUBBLE_OFFSET,0,width,height,ARC_DIAMETER,ARC_DIAMETER);
  g2d.setColor(fillColor);
  g2d.fillRoundRect(BUBBLE_OFFSET + 1,1,width - 2,height - 2,ARC_DIAMETER,ARC_DIAMETER);
  final Polygon p=new Polygon();
  p.addPoint(BUBBLE_OFFSET + 1,MARGIN_WIDTH + 1);
  p.addPoint(0,LINE_HEIGHT);
  p.addPoint(BUBBLE_OFFSET + 1,LINE_HEIGHT / 2 + MARGIN_WIDTH);
  g2d.fillPolygon(p);
  g2d.setColor(outLineColor);
  g2d.drawLine(0,LINE_HEIGHT,BUBBLE_OFFSET,MARGIN_WIDTH + 1);
  g2d.drawLine(0,LINE_HEIGHT,BUBBLE_OFFSET,LINE_HEIGHT / 2 + MARGIN_WIDTH);
}

private void drawBubble ( final Graphics2D g2d , final Color fillColor , final Color outLineColor , final int width , final int height ) { g2d . setColor ( outLineColor ) ; g2d . fillRoundRect ( BUBBLE_OFFSET , 0 , width , height , ARC_DIAMETER , ARC_DIAMETER ) ; g2d . setColor ( fillColor ) ; g2d . fillRoundRect ( BUBBLE_OFFSET + 1 , 1 , width - 2 , height - 2 , ARC_DIAMETER , ARC_DIAMETER ) ; final Polygon p = new Polygon ( ) ; p . addPoint ( BUBBLE_OFFSET + 1 , MARGIN_WIDTH + 1 ) ; p . addPoint ( 0 , LINE_HEIGHT ) ; p . addPoint ( BUBBLE_OFFSET + 1 , LINE_HEIGHT / 2 + MARGIN_WIDTH ) ; g2d . fillPolygon ( p ) ; g2d . setColor ( outLineColor ) ; g2d . drawLine ( 0 , LINE_HEIGHT , BUBBLE_OFFSET , MARGIN_WIDTH + 1 ) ; g2d . drawLine ( 0 , LINE_HEIGHT , BUBBLE_OFFSET , LINE_HEIGHT / 2 + MARGIN_WIDTH ) ; }
draw a chat bubble .
