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
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: 14687
    
  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
 
Similar Threads
ActionListener -- where to put anonymous inner class?
Button Listener
[newbie] Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
Java grid colouring in game
ActionListener and Event