how to set new text in JTextField after creation?

前端 未结 2 1759
北荒
北荒 2021-01-22 10:35

I have a jTextField , and I set it\'s value to a certain sum when I create the frame.
Here is the initiation code:

totalTextField.setText(
            itemsP         


        
2条回答
  •  一个人的身影
    2021-01-22 10:59

    Add a WindowListener to the frame. Then you can handle the windowActivated event and reset the text of the text field.

    See How to Write Window Listeners.

提交回复
热议问题