Originally posted by Hanna Habashy:
[...] Hence, you cannot rely on .properties to supply you with constants. The only solution, as I see it, is to hard code them in a constant class.
Not quite. If the properties are read only, you can package a .properties file in your jar and load it up using Class.getResourceAsStream() or ClassLoader.getResourceAsStream(). E.g.
Will load up "Foo.properties" from the same directory where "Foo.class" lives. Although by no means required, it's never a bad idea to move user interface text out of
Java classes altogether. Such text is often quite volatile, and will be a huge boon if i18n ever becomes an issue (obviously irrelevant for the assignment though).
- Peter