|
-
September 22nd, 2011, 06:53 PM
#4
Re: Help with ActionListener?
By giving the listener variable a value I meant giving it the value of a valid listener. null is not a valid listener value.
If you move the code out of the main method, then you will be able to get to the class variables without having to define them as static.
If the class implements ActionListener then the constructor can do this:
jTF.addActionListener(this); // define this class as the listener for the text field: jTF
You would not need to use the listener variable.
Norm
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|