Methods Summary |
---|
public void | buildGUIDialog(java.lang.String name)build the panel that comprises the dialog.
final String instanceName;
if (name == null) {
// no problem here.
instanceName = getClass()
.getName() + hashCode();
} else {
// no problem here as well.
instanceName = getClass()
.getName() + name;
}
JDialog dialog = new JDialog();
// .. Do a bunch of layout and component building.
dialog.setTitle(instanceName);
// .. Do dialog assembly
// instanceName = "hello"; // <= compiler error
|
public static final void | main(java.lang.String[] args)Test code.
System.out.println("Note how the key variable is changed.");
someMethod("JAVA_HOME");
someMethod("ANT_HOME");
|
public static java.lang.String | someBuggedMethod(java.lang.String environmentKey)Get an environment property.
final String key = "env." + environmentKey;
System.out.println("Key is: " + key);
// key = new String("someValue"); // <= compiler error.
return (System.getProperty(key));
|
public static java.lang.String | someMethod(java.lang.String environmentKey)Get an environment property.
final String key = "env." + environmentKey;
System.out.println("Key is: " + key);
return (System.getProperty(key));
|