Hi i was wondering if it was possible, in java, to save a session/state of an application and then reloading the data (all automatically)when re-opening??

I have a GUI with some textarea, a jtree with filesystem hierarchy and a jpanel with buttons. I can create many buttons and within these buttons are popup jtextarea's with text inside them.

I want to know if it is possible and maybe some pointers on how, i would go about automatically saving the numberof buttons, their names and the data cntained inside of them, and then close the program. Then, when re-opening the program, re-load the data saved?


Look up Serializable. You could write your base GUI Object out to file and then read it back in via Serialization.

Hi i believe i have managed to serialize the objects i want. However, upon doing that, im unable to re-click on any of the buttons...
I believe the actionperformed isnt being serialized and i've read up that this a problem...is there a workaroun? I've tried looking and figuring it out but can't do it.

I've serialized all the classess that need to be serialized but i just can't click on the buttons anymore, rendering them useless.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.