I was looking here: and saw mention of 'activate default button'. And according to the JRootPane javadoc, setDefaultButton: ' Sets the defaultButton property, which determines the current default button for this JRootPane.
The default button is the button which will be activated when a UI-defined activation event (typically the Enter key) occurs in the root pane regardless of whether or not the button has keyboard focus (unless there is another component within the root pane which consumes the activation event, such as a JTextPane). For default activation to work, the button must be an enabled descendent of the root pane when activation occurs. To remove a default button from this root pane, set this property to null. Looks like this is what you want, right?
![Activate Button Enter Key Java Activate Button Enter Key Java](https://www.ntu.edu.sg/home/ehchua/programming/java/images/AWT_WindowEventSeqDiagram.png)
How to Use Buttons, Check. ButtonDemo.java that creates the buttons in the previous example. Keyboard focus and the user presses the Return or Enter key.
![Activate Button Enter Key Java Activate Button Enter Key Java](http://images.slideplayer.com/25/8108269/slides/slide_5.jpg)
![Activate Button Enter Key Java Activate Button Enter Key Java](https://i.stack.imgur.com/xhhfd.png)
![See More On Stackoverflow See More On Stackoverflow](http://3.bp.blogspot.com/-Cpxcs85_dcI/T_TFNcA_eQI/AAAAAAAABbo/N-MCl0woqi8/s1600/JavaScript%2BENTER%2Bkey%2Bexample.png)