• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Swing, ActionEvent can't see button...

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1849
15
Eclipse IDE Spring VI Editor Java Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1849
15
Eclipse IDE Spring VI Editor Java Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1849
15
Eclipse IDE Spring VI Editor Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lovely and beautiful!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic