Description
Apache NetBeans version
Apache NetBeans 23
What happened
Summary: When making a pane in the NetBeans UI a floating pane (basically a separate window), then invoking the main menu via keyboard from the floating pane changes the focus back to the main window, and the menu loses keyboard focus. In consequence, it's impossible to perform menu actions for items in a floating pane.
This is a regression in NetBeans 16-23. This had worked since at least NetBeans 8 up to NetBeans 15, and stopped working with NetBeans 16.
This bug makes it impractical to use floating panes in conjunction with keyboard navigation and/or to select actions from the main menu that work on items in the floating pane, such as "Close " in the "How to reproduce" example below, or also actions like Team > Commit.
Language / Project Type / NetBeans Component
NetBeans UI, any project type
How to reproduce
What works:
- Open a project in NetBeans, open one of its source files in the editor.
- Press Ctrl+0 to focus the editor, then press Ctrl+1 to focus the Projects pane.
- While the keyboard focus is in the Projects pane, press Alt+F to open the file menu.
- Press cursor Up/Down to navigate in the File menu, finally press C to close the current project.
- Alternatively, while the keyboard focus is in the Projects pane, open the File menu with the mouse, and select "Close " to close the project.
What does NOT work:
- Open a project in NetBeans, open one of its source files in the editor.
- Make the Projects pane a floating pane, either by dragging it out of the main window, or by selecting "Float" in the context menu.
- Press Ctrl+0 to focus the editor, then press Ctrl+1 to focus the Projects pane.
- While the keyboard focus is in the Projects pane, press Alt+F to open the file menu.
- Bug 1: Press cursor Up/Down and/or press C => These keyboard presses don't take effect in the menu (despite the menu being open), but in the editor pane.
- Bug 2: While the keyboard focus is in the Projects pane, open the File menu with the mouse => "Close " is grayed out and can't be selected, presumably because the corresponding item in the Projects view lost the focus.
Did this work correctly in an earlier version?
Apache NetBeans 15
Operating System
Windows 10
JDK
Any JDK, specifically tested under 8, 11, 17, and 21
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
This bug may be a side effect of #4603. I had originally already reported this as #5062.
I'm willing to help any way I can in implementing a fix. This is an important issue to me and has held me back from upgrading from NetBeans 15.
Are you willing to submit a pull request?
Not at the moment, but possibly eventually.