Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6718771
Votes 0
Synopsis Nimbus L&F: Hitting Enter on focused JButton is not causing any action on Windows
Category java:classes_swing
Reported Against b27
Release Fixed
State 1-Dispatched, request for enhancement
Priority: 4-Low
Related Bugs 4659800
Submit Date 24-JUN-2008
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
Posted Date : 2008-06-24 22:29:23.0
Work Around
N/A
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
Posted Date : 2008-06-25 11:07:35.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang