Hello: I have a GUI application, see code below, after I run it, I re-organize the positions for all labels, eg. I put them into different poistions, or put then into center of JPanel. then I quit my application, nect time, when I re-run this program, I hope to see this last layout that I quit before: all labels are in center of JPanel, I google a while, no good results. Please advice how to do it and where to get goo example?? thanks
I had once worked on a similar requirement, where the user could select which columns in a table to display, their order, their preferred widths etc. We had come up with a preference framework which helped us do it.
In your case, you can try a similar approach. Essentially you will need to persist the information regarding the labels in some form while quitting the application. The next time you launch the application, you can retrieve this information and use it while laying out the components.
Persisting Preference Objects or using a properties file or some DB are likely solutions. The choice depends on what kind of framework you are using.
A google on "java preference framework" will give you good results. Best of luck.