TaT WorkingWithPropertiesFilesNB65

Working with properties files in NetBeans

Contributed by: Hubert A Klein Ikkink


Reposted from this blog entry: http://mrhaki.blogspot.com/2009/05/working-with-property-files-in-netbeans.html

Tips and Tricks

Properties files can be part of our Java applications, for example to store configuration settings. In NetBeans we create a new properties file via File | New File... | Other | Properties File. To add properties we simply open the file and add properties as a key=value pair in the editor. But we can use another method: right-click on the properties file and select Add | Property...:

File:prop_TaT_WorkingWithPropertiesFilesNB65.png

NetBeans opens a small dialog window and we can type the name, value and a comment (optional) for the new property. We click on the OK button to insert the property in our file.

File:prop1_TaT_WorkingWithPropertiesFilesNB65.png

In the Project Navigator we can view all properties in a properties file by clicking on the little arrow in front of the file. We select the property and the editor jumps to right position in the file.

File:prop2_TaT_WorkingWithPropertiesFilesNB65.png

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo