• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Swing, ActionEvent can't see button...

 
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

 
Bartender
Posts: 1847
14
Eclipse IDE Spring Java
  • 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
Bartender
Posts: 1847
14
Eclipse IDE Spring Java
  • 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
Bartender
Posts: 1847
14
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lovely and beautiful!
 
I'm gonna teach you a lesson! Start by looking at this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!