Is it possible to detect when someone presses Enter while typing in a JTextField in java? Without having to create a button and set it as the default.
Just use this code:
SwingUtilities.getRootPane(myButton).setDefaultButton(myButton);