You can for instance do IO.baseName(currentAO.getFile());
Thanks, for both replies. I guess I just over complicate things because I know just enough to get me into trouble
This should let me finish saving and loading template default values for use in multiple projects.
Good. You can refer to currentAO either as just currentAO or this.currentAO or super.currenAO, but AboutUI.currentAO is a reference to a
static variable and as currentAO is an
instance variable, it fails. Furthermore, AboutUI.this.currentAO is only allowed within nested classes as a way to refer to the outer scope.
On "static" and "instance" variables:
Think about the world of classes and instances in the Java world as you baking ginger cookies. For each shape of ginger cookie you have a steel template that can "stamp" any number of cookies into the dough. You might have a human shaped steel template, a heart-shaped steel template and so on. If we transfer this baking to Java, then your steel templates are your
classes and your ginger cookies are your
instances. The process of "stamping" a cookie out of a piece of dough, thereby creating a cookie is the same as the "new Foo()" call in Java. It's called
instantiation.
Now that we have this sorted out, let's introduce variables: They can be likened with properties of either your steel templates or ginger cookies. If it's a property of the steel template, for instance its weight or sharpness, then it's a "static" property/variable. If it's a property of individual cookies, for instance weight or color, then it's an ordinary
instance variable. When you wrote "AboutUI.currentAO", you directed Java to look for a "static" "currentAO" variable, belonging to the AboutUI class itself and not to the current instance. You were simply looking in the wrong spot for that variable.
Why the term "static"?
One may argue that it would be more intuitive if the keyword to denote variables that belongs to the class itself was called
class-variable or similar. The word "static" was chosen as it also refers to in what type of memory this variable type resides. They are, just like the class definitions and methods themselves, stored in the static memory region (doesn't shrink or grow during program execution), while objects, i.e. instances of classes, are stored in a dynamic memory area.