Suppose I have this:
class external
{
JFrame myFrame;
...
class internal implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
...
myFrame.setContentPane(this.createContentPane());
}
}
...
}
createContentPane returns a Container. Now, if I was doing this code outside of the ActionListener it would work, because I'd have access to this. But, inside it, I don't. I have access to myFrame, which is what is going to be updated with the contents of the method, but that isn't enough to do what I want, unless I can get a this out of it.
I also need information from other instance variables to use createContentPane(), so I'm not sure I can make it static.