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.
1) Maximum netbeans window. 2) relocate the "Projects" view form left side to right side. 3) Right-click on one project to open context menu in the "Projects" view. 4) Point mouse on "New" item to open sub-menu. 5) At this time, you can see the sub-menu is displayed on the right side and overlap with the super-menu. However, if you point mouse on "Set configuration", "CVS" or any other items which also will open sub-menu, the sub-menu will display on the left side of super-menu and won't overlap. I attached a screen shot. Please check it out.
Created attachment 50150 [details] screenshot of overlap
I can reproduce it on Mac OS => changing Platform and OS to All.
I'm not sure if this is the right component, feel free to reassign
It is Swing behavior. I assume it is by design. Simply context submenu is expected to be on right side of arrow in parent menu. But when there is no space on right side where would you put submenu? If you put it on left side there is usability issue with mouse - user would have to move mouse to the left to select desired item. Showing submenu on left side is worse IMO than opening as now over parent menu. I could file issue against Swing but: 1.I do not think it is *bug*. 2.I expect the same evaluation from Swing team. 3.Do you know *better* solution? I know similar situation when there is not enough space below so submenu is shifted (in most cases) up. But this is only similar not the same situation. I tried on JDK 7 b21 on Linux both Metal and GTK L&F.
IMHO, if there is no space on right side, the submenu should be placed on the left, at least on the Windows Platform. Because that how windows handle this problem. Maybe not perfect, but windows users are used to it. In fact, the issue I filed, only happens with the *New* submenu. Other submenus are just placed on the left when no space on the right side, why *New* is placed on the right?
I see. The way how submenu is displayed is controlled by Swing. I will investigate why New submenu is opened differently.
Reason is that New submenu is populated lazily in PopupMenuListener.popupMenuWillBecomeVisible but Swing computes location of submenu from present submenu items before. I did not find any workaround to this issue. I filed issue #6617411 against Swing. Passing this to projects/ui as it is code where New submenu is created. Probably WONTFIX. Example to demostrate this problem will be attached. Maximize app window and invoke popup menu on right side of app window so that there will be no available space for submenu on right side of popup menu.
Created attachment 51009 [details] Example to show incorrect submenu placing
I don't see how we could fix it if swing app behaves exactly the same way.
I'm not able to reproduce on Ubuntu 7.10, JDK 1.5.0_15, Metal L&F. The menu is "correctly" placed to the left. Closing as won't fix as it's swing problem and probably already fixed.
No this is NOT fixed in Swing. Just NewFile class does not fill menu in PopupMenuListener.popupMenuWillBecomeVisible. So it is 'fixed' in this case in NB. But still there is a lot of places where PopupMenuListener.popupMenuWillBecomeVisible is used. I did not check what is done in those occurrences and if the same problem might happen.
OK then, should we open the issue?
This issue can stay closed. Swing issue is opened. If there will be another case in IDE new issue will be opened and then it can be fixed as here or depend on Swing issue and closed as WONTFIX.
Original Swing issue is http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4743225