Pass values entered in one JFrame's text field as an input parameter in other JFrame

前端 未结 4 599
执念已碎
执念已碎 2020-12-17 07:42

How to pass values entered in one JFrame\'s text field as an input parameter in other JFrame?

Entered user name and password in first JFrame through

4条回答
  •  旧时难觅i
    2020-12-17 08:17

    first create publicly static type variable

    public static JTextField txt2; public JTextField txt1,button1;

    //action button1 in 1st JFrame

    JFrame2.setVisible(true); JFrame2.txt2.setText(Me.txt1.getText());

提交回复
热议问题