How to save application options before exit?

前端 未结 4 1996
一个人的身影
一个人的身影 2020-12-13 05:01

I have made an application and i need to save some options before exit.(something like window dimension, ..., that will be written in a file.)

The main frame has set

4条回答
  •  無奈伤痛
    2020-12-13 05:21

    You may register a WindowListener and save your options in the windowClose method.

    And of course

    frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    

提交回复
热议问题