• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How to save configuration for my application??

Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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??

Posts: 11445
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic