File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes addActionListener problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "addActionListener problem" Watch "addActionListener problem" New topic
Author

addActionListener problem

Jesse Crockett
Ranch Hand

Joined: Feb 03, 2005
Posts: 129
what's the problem with this code? I get errors that the buttons aren't found inside the actionPerformed method...

Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Declare the buttons as private class members, not as local variables in the constructor.


[My Blog]
All roads lead to JavaRanch
Jesse Crockett
Ranch Hand

Joined: Feb 03, 2005
Posts: 129
thanks! :-)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: addActionListener problem