code: private void showSystemMenu() {
          Insets insets = rootPane.getInsets();
          windowMenu.show(menuButton, getX() - insets.left - insets.right,
              getY() + this.getPreferredSize().height);
      }
docs: Show the system menu.