Remember window positions in swing

前端 未结 5 1498
别那么骄傲
别那么骄傲 2021-01-11 23:22

I have a pretty big swing application and i want to make it remember sizes of all windows, jframes etc. So if user resized window how he likes, next time the window looks ex

5条回答
  •  终归单人心
    2021-01-11 23:36

    Whatever you want to remember on the next invocation (window position, etc.) write to a file, and read that file from start up. It's going to need to be persisted to disk, nobody knows what you really want saved (probably not the time sensitive data), and any "automatic" solution can't work unless it also saves the time-sensitive data.

    Would you want your application to restore with a record displayed that had been deleted? Probably not.

提交回复
热议问题