ENTER key using in JTextField java

前端 未结 2 1615
臣服心动
臣服心动 2020-12-11 21:04

I\'m using two JTextField in Java Swing form. Now I enter the values in JTextField1. Next if I press ENTER KEY means the cursor move to

2条回答
  •  忘掉有多难
    2020-12-11 21:38

    Add an ActionListener to the first text field. In the ActionEvent you can get the source object, cast it to a JTextField and then invoke the transferFocus() method.

提交回复
热议问题