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 27629 - cannot add JSeparator to a JMenuBar
Summary: cannot add JSeparator to a JMenuBar
Status: RESOLVED DUPLICATE of bug 16591
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P4 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-27 03:50 UTC by fnisol
Modified: 2003-02-27 15:32 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 fnisol 2002-09-27 03:50:43 UTC
I tried to add a JSeparator to a JMenuBar so Help menu is 
rejected to right end, but It is absolutely impossible. I 
can only add JMenuItem... Impossible also to add an 
Action ....
Comment 1 Richard Malaschitz 2002-10-07 13:44:52 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.

Comment 2 fnisol 2002-10-08 12:56:28 UTC
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
Comment 3 Tomas Pavek 2003-02-27 15:32:27 UTC
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 ***