private void showSystemMenu(){
  Insets insets=frame.getInsets();
  if (!frame.isIcon()) {
    systemPopupMenu.show(frame,insets.left,getY() + getHeight());
  }
 else {
    systemPopupMenu.show(menuButton,getX() - insets.left - insets.right,getY() - systemPopupMenu.getPreferredSize().height - insets.bottom- insets.top);
  }
}

private void showSystemMenu ( ) { Insets insets = frame . getInsets ( ) ; if ( ! frame . isIcon ( ) ) { systemPopupMenu . show ( frame , insets . left , getY ( ) + getHeight ( ) ) ; } else { systemPopupMenu . show ( menuButton , getX ( ) - insets . left - insets . right , getY ( ) - systemPopupMenu . getPreferredSize ( ) . height - insets . bottom - insets . top ) ; } }
show the system menu .
