Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Swing, ActionEvent can't see button...

 
Jacob Morehouse
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1809
12
Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Jacob Morehouse
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1809
12
Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1809
12
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lovely and beautiful!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic