public void paintPeer(Graphics g){
  resetColors();
  int width=getWidth();
  int height=getHeight();
  flush();
  g.setColor(getBackgroundColor());
  g.fillRect(1,1,width - 2,height - 2);
  draw3DRect(g,0,0,width,height,true);
  MappingData mappingData=(MappingData)getMappingData();
  XMenuItemPeer[] itemVector=mappingData.getItems();
  XMenuItemPeer selectedItem=getSelectedItem();
  for (int i=0; i < itemVector.length; i++) {
    XMenuItemPeer item=itemVector[i];
    g.setFont(item.getTargetFont());
    Rectangle bounds=item.getBounds();
    Point textOrigin=item.getTextOrigin();
    if (item == selectedItem) {
      g.setColor(getSelectedColor());
      g.fillRect(bounds.x,bounds.y,bounds.width,bounds.height);
      draw3DRect(g,bounds.x,bounds.y,bounds.width,bounds.height,false);
    }
    if (isFramePeerEnabled() && item.isTargetItemEnabled()) {
      g.setColor(getForegroundColor());
    }
 else {
      g.setColor(getDisabledColor());
    }
    g.drawString(item.getTargetLabel(),textOrigin.x,textOrigin.y);
  }
  flush();
}

public void paintPeer ( Graphics g ) { resetColors ( ) ; int width = getWidth ( ) ; int height = getHeight ( ) ; flush ( ) ; g . setColor ( getBackgroundColor ( ) ) ; g . fillRect ( 1 , 1 , width - 2 , height - 2 ) ; draw3DRect ( g , 0 , 0 , width , height , true ) ; MappingData mappingData = ( MappingData ) getMappingData ( ) ; XMenuItemPeer [ ] itemVector = mappingData . getItems ( ) ; XMenuItemPeer selectedItem = getSelectedItem ( ) ; for ( int i = 0 ; i < itemVector . length ; i ++ ) { XMenuItemPeer item = itemVector [ i ] ; g . setFont ( item . getTargetFont ( ) ) ; Rectangle bounds = item . getBounds ( ) ; Point textOrigin = item . getTextOrigin ( ) ; if ( item == selectedItem ) { g . setColor ( getSelectedColor ( ) ) ; g . fillRect ( bounds . x , bounds . y , bounds . width , bounds . height ) ; draw3DRect ( g , bounds . x , bounds . y , bounds . width , bounds . height , false ) ; } if ( isFramePeerEnabled ( ) && item . isTargetItemEnabled ( ) ) { g . setColor ( getForegroundColor ( ) ) ; } else { g . setColor ( getDisabledColor ( ) ) ; } g . drawString ( item . getTargetLabel ( ) , textOrigin . x , textOrigin . y ) ; } flush ( ) ; }
overriden xwindow painting & printing
