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.
The bug is present when you as a user navigate a dialog without a mouse (just using your keyboard) and this dialog has a default button. Lets say that the dialog have the two buttons OK and Cancel where OK is default. You use TAB in order to focus on the CANCEL-button and then press ENTER. Instead of invoking the CANCEL-button as expected, you instead invoke the default OK-button. Try 1. Navigate->Go to type... 2. Type something in order to enable the OK-button 3. Press Shift-TAB in order to focus the Cancel-button. At this point you can see that the OK-button still is "default". Normal behavior on Windows is to make the Cancel-button look default at this moment. 4. Hit ENTER and notice that the OK-button is invoked instead of the expected Cancel-button. If you however press TAB, the Cancel-button is invoked. I experience the same effect when using NotifyDescriptor/DialogDisplayer in my netbeans platform application and my users are confused since they think that they have canceled an operation.
Note four should have been.. 4. Hit .... If you however press ====>>> SPACE <<<====, the Cancel-button is invoked.
Reassigning to utilities for evaluation.
Is it Go To type specific or is it default behavior for all dialogs in NetBeans?
> I experience the same effect when using NotifyDescriptor/DialogDisplayer in my netbeans platform application and my > users are confused since they think that they have canceled an operation. Isn't it default behavior?
IMO, the ENTER and ESC are reserved for default confirm and cancel buttons. It worked in the same way in 6.1
Perhaps I misunderstand the INVALID resolution but if it means that you do not consider this a bug, let me try to convince you;-) NetBeans does not follow standard Microsoft Windows way to handle this. Perhaps it is the standard of Mac or Linux but not Windows. This will make my users confused. When you focus a button (no mouse involved) and press ENTER you always invoke that button disregarding default buttons. You could for example try the print-dialog from Microsoft Word or Open Office. When you have focus on a button and press ENTER, that button is always pressed disregarding the default button. I would say that this problem is in all the NetBeans dialogs. If you for example select Ctrl-Shift-F to invoke Edit- >Find in Projects and type "something". Your dialog will now have "Find", "Close" and "Help" as buttons in the dialog. If you shift-Tab to focus the Help button and press ENTER, you do expect the help to be presented. Instead you have envoked the default Find-button. A more extrem example is if I where to create my own dialog in my RCP-application with the default button "Yes" followed by "No" and "Help". If I then use that dialog and ask my user "Do you really want to delete everything?". My experienced Microsoft Windows user would then be very suprised when he pressed ENTER on the focused "No"-button if that action wiped out the content of the database. Kindest regards, Björn
Another example where you as a user of NetBeans can experience this while editing a java-class. 1. Edit your clss without a mouse 2. Press Ctrl+W in order to close it when it contains unsaved changes. 3. The dialog asks you "File xxx.java is modified. Save it ?" You are now focused on the default "Save" button. 4. Press TAB and focus "Discard"-button. Save-button is no longer default. Press ENTER now to discard your changes. This is the expected MS Windows behaviour. 5. If you instead TAB once more in order to focus the "Cancel"-button, the Save-button is still marked as default. Pressing ENTER at this stage will save the file instead of the expected cancelation. With hopeful regards, Björn
Where it works... In the refactor-dialogs everything works as expected. If I for exemple... 1. Select something in my java-code and and press Ctrl+R in order to rename that something I get the "Rename"-dialog where the "Refactor"-button is default 2. I Shift-tab to focus the "Help-button". 3. I press <ENTER> and invokes the expected help-button Kindest regards, Björn
Jano, could you comment on last bjorn's comments?
Similar issue has already been reported: http://www.netbeans.org/issues/show_bug.cgi?id=50803 NetBeans is really inconsistent with Win XP in this regard. For users used to using keyboard for navigating in dialogs on Win XP, this is certainly a problem. Ideally Swing would automatically adjust focus behavior depending on the OS platform. Is something like that happening in some of the dialogs (Refactor) as indicated by bjorn?
I'll look on it again.
This bug still exists in 6.8 even though the target milestone is 6.7 Are there any plans to fix it? Thanks
*** Bug 187365 has been marked as a duplicate of this bug. ***
This has come up several times in our RCP application accessability and usability sessions, I checked 6.9 and its still present. Could anyone comment when / if its to be fixed?
core-main ab3f293d62c6
This fix is wrong; you cannot just call setDefaultCapable on every button, because many are never supposed to be default capable. Concrete regression: New Project wizard; NetBeans Module / Module, Next; use default Name, Next. Now on the third panel, Next and Finish are both disabled, since "Please specify code name base" appears. Previously, no button was set as default in this case, and ENTER did nothing, which was correct. Now, Help is set as default (visible border on button) and ENTER opens the help browser, which is wrong.
core-main d93a25a3a99c
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/ab3f293d62c6 User: S. Aubrecht <saubrecht@netbeans.org> Log: #148268 - ENTER key must invoke focused button instead of the default one
*** Bug 204066 has been marked as a duplicate of this bug. ***
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/d93a25a3a99c User: S. Aubrecht <saubrecht@netbeans.org> Log: #148268 - no default button when the default button is disabled
Reopened, because I experience the same issue with NB 7.2 in all dialogs I tried. Example: In the file browser / project browser choosing to delete a file will open a confirmation dialog ("Confirm Object Deletion"). Tabbing to "No" and pressing ENTER will delete the file anyway, because the default button is "Yes" (happend to me, only mild damage done). Pressing SPACE works correctly. ----- Product Version: NetBeans IDE 7.2 (Build 201207171143) Java: 1.6.0_24; OpenJDK Client VM 20.0-b12 System: Linux version 3.0.0-24-generic running on i386; UTF-8; de_DE (nb)
File chooser and Project chooser windows do not use NetBeans Dialogs API.