このコードに基づくJava APPでフルスクリーンモードを実現しようとしています
private static void createAndShowGUI()
{
    //Create and set up the window.
    JFrame frame = new JFrame("Mouse Click Demo");
    //Make it non-Resizable
    frame.setResizable(false);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //Create and set up the content pane.
    JComponent newContentPane = new MouseEventDemo();
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newContentPane);
    //Display the window.
    frame.pack();
    //frame.setVisible(true);
    if (!frame.isDisplayable())
    {
        // Can only do this when the frame is not visible
        frame.setUndecorated(true);
    }
    GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
    try
    {
      if(gd.isFullScreenSupported())
      {
         gd.setFullScreenWindow(frame);
         System.out.print("DOES SUPPORT");
      }
      else
      {
          //Can't run in full screen mode
          System.out.print("DOES NOT SUPPORT");
      }
      frame.setVisible(true);
    }
    finally
    {
     gd.setFullScreenWindow(null);
    }
}
問題は、Macbook で実行すると、上部の Mac バーと下部のデッキが引き続き表示されることです。コンソールは状態に入り、DOES SUPPORTを出力しますが、フルスクリーン モードではまだ表示されません。
私は何をしているのですか?