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.
Summary: | IDE does not load / ignores some properties of exitMenuItem created with Swing Java App. template | ||
---|---|---|---|
Product: | guibuilder | Reporter: | xzemanekj <xzemanekj> |
Component: | Code | Assignee: | issues@guibuilder <issues> |
Status: | RESOLVED WONTFIX | ||
Severity: | blocker | ||
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
xzemanekj
2009-09-17 11:36:17 UTC
AFAIU this issue is assigned to the wrong component ("properties"), because it has not any relations to the property files. Could you please, reassign it to a correct component (may be "form" component)? Reassigned to FORM component. Reproducible. Under Swing Application Framework the menu items use actions, so shortcuts, mnemonics, text, icon, etc should be defined for the action (in action property editor). The action when set ensures the appropriate menu item's properties are set. If the properties are set directly on the menu item, they override those from the action. The code is generated correctly, so action is set first allowing the properties be changed additionally. But when the form is loaded into the GUI builder, it probably sets the action later than the properties, which resets the explicitly set values. The workaround is to modify the action as described above, the properties should only be set if on some component the presentation should differ from the action definition. It's better to avoid the order-dependent settings (which is against JavaBeans spec). I've just encountered this issue, and as it took some figuring out, here's what I discovered: When setting both an Action AND a Mnemonic on a menu item, be aware that the Properties "mnemomic" setting gets overwritten by what you set in the Action dialog. This also applies to the shortcut, if you set it by double-clicking the "shortcut" space on the visual menu. What does this mean? - Your mnemonic and shortcut settings will appear until you close the file, and will be correctly saved in the .form file, but will not appear in the editor next time you re-open the file in the GUI Builder. - Your mnemonic and shortcut will not appear in the built program. While this is unfortunate, it does appear to be an intended order of priority, which the GUI Builder simply doesn't account for. (And overwrites later, if you save it after closing and re-opening.) To get past it: - When setting the Action, set the shortcut and mnemonic IN the Action dialog. - To set the shortcut, click in Accelerator > Letter and hit the desired shortcut on the keyboard. - To set the mnemonic, re-type the MenuItem text in the Text field, placing an ampersand (&) directly before the mnemonic character. ("&File" for "F", "Set N&ame" for "a", etc.) Ideally, NetBeans GUI Builder will be upgraded to link the MenuItem properties to the Action, OR to disable these properties (with a tooltip indicating to set them in the Action dialog) whenever an Action is assigned. This bug is specific to Swing Application Framework and support of this technology/library has been discontinued => I am closing this issue as 'will not fix'. |