Reset JComponent to default value

后端 未结 5 563
广开言路
广开言路 2021-01-21 16:58

For example, if component is a checkbox it must set to false, or it is a textfield it must be clear the text. I am trying to write a method for reset all components in a J

5条回答
  •  佛祖请我去吃肉
    2021-01-21 17:16

    As a good developer, you probably have a nice separation between view and model. When the model gets updated, those changes are then reflected in the view.

    If you have such structure, you could simply reset your model to a default state, and that reset-ed state then become visible in the UI (which means the UI is reset to its default state)

提交回复
热议问题