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: | cannot add JSeparator to a JMenuBar | ||
---|---|---|---|
Product: | guibuilder | Reporter: | fnisol <fnisol> |
Component: | Code | Assignee: | issues@guibuilder <issues> |
Status: | RESOLVED DUPLICATE | ||
Severity: | blocker | ||
Priority: | P4 | ||
Version: | 3.x | ||
Hardware: | PC | ||
OS: | Windows ME/2000 | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
fnisol
2002-09-27 03:50:43 UTC
In javadoc for JSeparator is written: JSeparator provides a general purpose component for implementing divider lines - most commonly used as a divider between menu items .... You can add to JMenuBar any component (JSeparator, JButton, ...), but it is not standard and it is not supported by Netbeans. I'm sorry, I made a mistake saying I could not add a JSeparator... I wanted to add a Box.createHorizontalGlue() component so help menu is rejected to the right part of the window. (since I was not able to do this, I did not remember it was not a separator but a glue I wanted to put there) Adding a JSeparator is not needed, but instead an horizontal glue could be needed Also, why netbeans does not support something that is supported in java ? Adding something else than a menu in a JMenuBar could be usefull, we cannot assume what a developper wants to do ... There is a workaround for this: You can use the post/pre init code of a JMenuItem to add whatever you want in the JMenuBar There is a need of redesign the way how form editor handles menus - so they behaved like any other visual component. There are several issues entered about this - e.g. issue 16591, issue 14785, or issue 13354. As for Box.createHorizontalGlue(), that's also already reported, see issue 8304. Until this is solved, please use the workaround... *** This issue has been marked as a duplicate of 16591 *** |