Register a Static JButton
I have a JButton that is declared static in my class decalarations. When I try to register the button in a static method using:
saveDataButton.addActionListener(this);
I get the error message:
non-static variable this cannot be referenced from a static context saveDataButton.addActionListener(this);
^
To get around this error, I tried to use:
Action x=saveDataButton.getAction();
saveDataButton.addActionListener(x);
I didn't get the compile error, but the button doesn't fire with this code.
Can you provide assistance with registering this as 'static' or a way to get around the above problem?
Any assistance would be greatly appreciated.
Scott

