protected void paintCaption(Graphics g,Rectangle rect){
  String s=getTargetLabel();
  if (s.equals("")) {
    return;
  }
  g.setFont(getTargetFont());
  FontMetrics fm=g.getFontMetrics();
  String str=getTargetLabel();
  int width=fm.stringWidth(str);
  int textx=rect.x + (rect.width - width) / 2;
  int texty=rect.y + CAPTION_MARGIN_TOP + fm.getAscent();
  int sepy=rect.y + rect.height - CAPTION_SEPARATOR_HEIGHT / 2;
  g.setColor(isTargetEnabled() ? getForegroundColor() : getDisabledColor());
  g.drawString(s,textx,texty);
  draw3DRect(g,rect.x,sepy,rect.width,2,false);
}

protected void paintCaption ( Graphics g , Rectangle rect ) { String s = getTargetLabel ( ) ; if ( s . equals ( "" ) ) { return ; } g . setFont ( getTargetFont ( ) ) ; FontMetrics fm = g . getFontMetrics ( ) ; String str = getTargetLabel ( ) ; int width = fm . stringWidth ( str ) ; int textx = rect . x + ( rect . width - width ) / 2 ; int texty = rect . y + CAPTION_MARGIN_TOP + fm . getAscent ( ) ; int sepy = rect . y + rect . height - CAPTION_SEPARATOR_HEIGHT / 2 ; g . setColor ( isTargetEnabled ( ) ? getForegroundColor ( ) : getDisabledColor ( ) ) ; g . drawString ( s , textx , texty ) ; draw3DRect ( g , rect . x , sepy , rect . width , 2 , false ) ; }
paints menu window ' s caption . can be overriden for popup menus and tear - off menus . default implementation does nothing
