ok, well you are saying this.openFileButton. I believe your problem is you are misinterpretting what
this is referencing to. The keyword
this references to the class that contains the keyword. So, when you have a nested class (such as the one I assume you have above),
this is referring to the nested class, not the outer class.
Look at the code below:
public class OuterClass
{
int var = 0;
public OuterClass()
{
System.out.println(this.var); //References OuterClass's var variable
}
public class InnerClass
{
int var = 0;
public InnerClass()
{
System.out.println(this.var); //References InnerClass's var variable
}
public class InnerInnerClass
{
int var = 0;
public InnerInnerClass()
{
System.out.println(this.var); //References InnerInnerClass's var variable
}
}
}
}
Now, if you wanted to reference OuterClass's var variable from inside the InnerClass (by using the keyword
this), you would have to say:
public class OuterClass
{
int var = 0;
public OuterClass()
{
System.out.println(this.var); //References OuterClass's var variable
}
public class InnerClass
{
int var = 0;
public InnerClass()
{
System.out.println(OuterClass.this.var); //References OuterClass's var variable
}
}
}
Does that make sense? And could that be your problem?