4

I have a Swing application that runs on Mac. When the user opens any JDialog like the JFileChooser i want automatically the "About App_Name", "Quit App_Name" menu items in the Mac's menu beside the apple button at the top left of the screen to appear disabled, so the user won't be able to click them.

Is this possible ?

Kai
  • 38,985
  • 14
  • 88
  • 103
Brad
  • 4,457
  • 10
  • 56
  • 93

1 Answers1

3

By default, the application menu entries do nothing when a modal dialog has focus, but the appearance is unaffected; this is standard on Mac OS X interface. Of course, your application's own menus should be enabled or disabled as appropriate. You can intercept the relevant events using OSXAdapter, as shown in this answer.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • Yes, Mac's menu items do nothing(While still enabled) when a modal dialog has focus, but i have seen in a program called VLC(http://www.videolan.org/vlc/download-macosx.html) that when i click "Open file" and a file chooser dialog appears, Mac's About menu item becomes disabled. I am just wondering how did they do that ? – Brad Nov 04 '11 at 05:01
  • Because VLC creates all its menus, it can enable and disable them directly. In Java you can only alter menus that you create. – trashgod Nov 04 '11 at 06:14