Re: Can someone help me out
You've already written an ActionListener. I'm not sure what your question is? I'd start by adding a print statement in there at least.
Re: Can someone help me out
it's complaining that the txtfield should be final and I don't think it's supposed to be.
Re: Can someone help me out
variables defined/declared inside of a method go away when the method exits. Use of final tells the jvm to keep their value around so code like in a listener can access them.
Or move their definition out of the method and it should work.
Re: Can someone help me out
Quote:
Originally Posted by
Norm
variables defined/declared inside of a method go away when the method exits. Use of final tells the jvm to keep their value around so code like in a listener can access them.
Or move their definition out of the method and it should work.
Actually, I believe that it's because an inner class will make copies of the local variables that they use, and if the variable is not final, there's a chance that one version will change and not match the other.