Enter key controls buttons

Is it a new feature that buttons respomd to the enter key? Or did I just never notice it before.

In my application, if the user hits enter, it’s as if the last button clicked get clicked again.

I never noticed this before, can it be disabled?

It’s new-ish… If the button has keyboard focus it’ll respond to the return key. You can disable it by telling the button not to take keyboard focus with setWantsKeyboardFocus (false).

In ShinyLookAndFeel it seems as if button look slightly different when they have the keyboard focus. In the normal LookAndFeel they don’t seem to be any different when they have the focus.

If a button is going to do something when enter is pressed I think it should be a little more visible, it should have a focus rect or something.

True. I never bother much with the standard look and feel, so didn’t notice that.