简体   繁体   中英

java 8 neatbeans 8.0.2 swing component jTextfield

I am working with Java 8 and NetBeans 8.0.2.

I can't insert a private void jTextField1KeyReleased(java.awt.event.KeyEvent evt) method by right clicking into the jTextField .

This is to complete a okBtnActionPerformed(java.awt.event.ActionEvent evt) method. It is to allow user to put a data using the "return key" instead of "OK button".

It is to allow user to put a data using the "return key" instead of "OK button"

Then you can add an ActionListener to the text field. More specifically you can add the same ActionListener that you add to the OK button. Then the user can either click on the button or use the Enter key when focus is on the text field.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM