Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Event listener not responding  RSS feed

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't want to put all the code up, just what I think is relevant. Basically, I have a JTextField called productCode, but the Look Up button isn't getting the text and processing it.. I don't know what's wrong. Let me know if more code is needed.

 
author and iconoclast
Sheriff
Posts: 24220
40
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Based only on what we can see here, of course: when the bolded line is executed, lookUpHandler is null. I don't see where you ever construct an instance of ButtonHandler to store into it.

An aside: why are all your members static? If you're initializing them in a constructor, then they needn't be, nor should they be, static.
 
Jesse Crockett
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most of it was something the teacher passed out. She wanted us to use JPanel. She says that code is "more elegant."

so..

I'll try that.
 
Jesse Crockett
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works! Thanks.

ur the greatest
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!