How to convert JTextField to String and String to JTextField?

前端 未结 4 1038
余生分开走
余生分开走 2020-12-20 19:00

How to convert JTextField to String and String to JTextField in Java?

4条回答
  •  太阳男子
    2020-12-20 19:23

    JTextField allows us to getText() and setText() these are used to get and set the contents of the text field, for example.

    text = texfield.getText();
    

    hope this helps

提交回复
热议问题