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 Swing, ActionEvent can't see button... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Swing, ActionEvent can Watch "Swing, ActionEvent can New topic
Author

Swing, ActionEvent can't see button...

Jacob Morehouse
Greenhorn

Joined: Feb 22, 2012
Posts: 17
Hello!

I've been lurking for a few months, first post... In Eclipse, the error is on: e.getSource() == calculate_button. "calculate_button cannot be resolved to a variable." Any ideas? I've been stuck here for a few hours, but I'm sure it is probably something simple.

Thank you very much for any help of comments provided!

Daragaaz

Janeice DelVecchio
Saloon Keeper

Joined: Sep 14, 2009
Posts: 1613
    
  10

You're using the calculate_button reference outside the scope from where it's declared. I can elaborate if you don't know what that means.

Welcome to CodeRanch!


When you do things right, people won't be sure you've done anything at all.
Jacob Morehouse
Greenhorn

Joined: Feb 22, 2012
Posts: 17
Janeice DelVecchio wrote:You're using the calculate_button reference outside the scope from where it's declared. I can elaborate if you don't know what that means.

Welcome to CodeRanch!


Thank you Janeice!!! I wasn't expecting an immediate response!

I'm stubborn, I'll spend a few minutes to see if I can figure it out... I usually remember those painful 'eureka' moments better, lol.

Daragaaz
Janeice DelVecchio
Saloon Keeper

Joined: Sep 14, 2009
Posts: 1613
    
  10

Jacob Morehouse wrote:Thank you Janeice!!! I wasn't expecting an immediate response!



I'm glad you appreciate the fast response.

Post again if you want more pointers.
Jacob Morehouse
Greenhorn

Joined: Feb 22, 2012
Posts: 17
Thank you Janeice, that did the trick. You are correct. It didn't immediately click what that meant, but as I looked it over it makes sense. In case anyone else get's stuck, the corrected version of my code is below.


Daragaaz



Janeice DelVecchio
Saloon Keeper

Joined: Sep 14, 2009
Posts: 1613
    
  10

Lovely and beautiful!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Swing, ActionEvent can't see button...
 
Similar Threads
code can't work
Applet doesn't show up with IE
GridBag help
Restart login if a wrong password is writed. (Java Swing)
Creating and opening a window if the button is clicked in an applet