JDK-6718771 : Nimbus L&F: Hitting Enter on focused JButton is not causing any action on Windows
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u10
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: windows
  • CPU: x86
  • Submitted: 2008-06-24
  • Updated: 2011-04-28
Related Reports
Relates :  
Description
Hitting Enter on focused JButton is not causing any action on Windows OS. This is a very handy feature to improve the user experience of the application. This works in Windows Look and Feel, GTK Look and Feel on Linux but not in Metal,   Ran the attached program with the Nimbus Look and Feel on Linux, it is working as expected.  The issue is only with Windows OS.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run the attached program 
2. Hit <ENTER> key
3. Notice that there is no System.out

Comments
EVALUATION LookAndFeel doesn't have to press button when it is focused and you hit enter, e.g. MetalLookAndFeel works this way This functionality is specific to Windows and thus supported by WindowsLookAndFeel, to make it work on other Lafs you should set a default button, this way: getRootPane().setDefaultButton(butt1); after that hitting enter on most of the components inside a frame will activate the default button so it's not a bug I'll change the type of this CR to RFE and assign it to Nimbus team in case they want to be similar with WindowsLaf in this matter
25-06-2008