This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 258422 - Wrong accelerator key icon in swing menu on OSX
Summary: Wrong accelerator key icon in swing menu on OSX
Status: NEW
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 8.1
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-17 18:50 UTC by Elmoe
Modified: 2016-04-03 20:57 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elmoe 2016-03-17 18:50:21 UTC
I created an application using Netbeans 8.1 on OSX with the guibuilder. I added the classical "edit" menu to it with the items "cut", "copy" and "paste". I then added keyboard shortcuts to the items. Because i use OSX, i added the cmd-Key for this purpose. The icon in the guibuilder is shown as the classical Apple key '⌘'. This is the correct behavior. 

When i run the application a text 'meta' is displayed instead of the Apple key '⌘' in the menu. This happens when i use guibuilder after choosing "Swing GUI Forms" -> "Application" or "Swing GUI Forms" -> "JDialog" in Netbeans. 

When i manually code everything by choosing an empty Java file, i get the the Apple key '⌘' displayed correctly. You can find screenshots and example source code here: 

http://stackoverflow.com/questions/35925578/java-on-osx-wrong-accelerator-key-icon-in-swing-menu-using-netbeans-gui-builder 

Thank you in advance and best regards, 
Elmoe
Comment 1 Elmoe 2016-04-03 20:57:44 UTC
The error is caused by the auto-generated code of the GUI builder in the method:
public static void main(String args[])

This what is generated:
if ("Nimbus".equals(info.getName())) 

For Netbeans GUI builder on OSX it should be:
if ("Mac OS X".equals(info.getName()))

If you change this manually then the preview from GUI builder shows the same result like the application.

Best regards,
Elmoe