java - Need help with making a settings file -


I am trying to create an application launcher which has a settings file that includes 'name' and paths for programs Will save the program, and when you type the name in an input box, it will run the program that the name is assigned.

In addition, if that name is entered, then the application will not be known by the application (in the setting file), the user should add the path and save that file from the user set path in the settings file.

What do I need to do? This is the best way to do this and write / write files,

Any suggestions?

You can use - it adds a key / value to a text file, and instant It is quite easy. Ex:

  Properties mySettings = new properties (); MySettings.load (new FileInputStream ("myapp.cfg")); // getProperty () returns a string filepath 1 = mySettings.getProperty ("filePath1");  

Then you can just save your settings in myapp.cfg , either directly (with this key = value ) Is a simple text file), or via mySettings.store (...) . The contents of myapp.cfg will look something like this:

  # Adds the date and date properties to the object file path1 = / usr / bin / share / filename otherVar = 52  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -