Thura
Thura

Reputation: 297

How to maintain application geometry, size (including child widgets') through sessions

I am writing a small application in GTK+ and java, and I want it to maintain its position, size, including those of child widgets, for each session. Is there any other way instead of manually storing size of each child widgets, and recovering them at startup?

Upvotes: 0

Views: 136

Answers (1)

Gunslinger47
Gunslinger47

Reputation: 7061

In my recent project, I used java.util.Properties to track and save any changes I was interested in. If there's a better way to do this, it's probably serialization. javax.swing.JFrame is Serializable, so you should theoretically be able to just save your entire frame and its non-volatile properties to disk the load it back up exactly as it was.

Upvotes: 2

Related Questions