File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

saving properties...

 
Jhedzkie Skies
Ranch Hand
Posts: 118
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i've got an eye on this very useful class of java...

java.util.Properties

well. i tried to read and understand the API but i guess, its really too advanced for me..
anyway, i just want to apply the saving of properties on my app,,

i have a menu in my program that will change the WindowDecorationStyle. but, i want my program to save the current decoration so when
my program is executed again, it will load the same style.
please help me understand the usage of properties in the most simple way..

thanks.
 
Rob Spoor
Sheriff
Pie
Posts: 20381
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's so advanced about Properties? You can:
- retrieve properties if you know the name by using getProperty
- set properties using setProperty
- get all property names using propertyNames, stringProperties or (using the fact that Properties extends Hashtable) keySet
- put contents of a file into the Properties object using load. You can use a FileInputStream or FileReader to read from files, or Class.getResourceAsStream to read from resources
- save the contents to a file using store. You can use FileOutputStream or FileWriter for files; you can't write to resources
 
Jhedzkie Skies
Ranch Hand
Posts: 118
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Prime wrote:What's so advanced about Properties? You can:
- retrieve properties if you know the name by using getProperty
- set properties using setProperty
- get all property names using propertyNames, stringProperties or (using the fact that Properties extends Hashtable) keySet
- put contents of a file into the Properties object using load. You can use a FileInputStream or FileReader to read from files, or Class.getResourceAsStream to read from resources
- save the contents to a file using store. You can use FileOutputStream or FileWriter for files; you can't write to resources


thanks mr. rob prime.
this definitely lightened up things for me. i'll try to work on it and post here some improvements.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic