Steps for loading a properties file

This section contains some very simple examples of configuration files and demonstrates how the properties defined there can be read from Java code.

A simple properties file

At first lets consider that the whole configuration data of an application consists of a single properties file named usergui.properties with the following content:


#Properties definining the GUI
colors.background=#FFFFFF

				

Note that this file complies to the typical format of properties files.

You can also have in a simple properties file various characters that are typically escaped like \n, \t etc:


#Unescaped string that will be escaped
test.unescape = This \n string \t contains \" escaped \\ characters