Copy the code below and insert in your public class or form load event like image below. Focus on the highlighted part of the code. The jButton1 is the button we perform the event. When you press Enter in the keyboard the jButton1 perform the event.
Just copy the code below and modify on your own needs.