aspose file tools*
The moose likes Beginning Java and the fly likes Event listener not responding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Event listener not responding" Watch "Event listener not responding" New topic
Author

Event listener not responding

Jesse Crockett
Ranch Hand

Joined: Feb 03, 2005
Posts: 129
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.

Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24184
    
  34

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.


[Jess in Action][AskingGoodQuestions]
Jesse Crockett
Ranch Hand

Joined: Feb 03, 2005
Posts: 129
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

Joined: Feb 03, 2005
Posts: 129
It works! Thanks.

ur the greatest
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Event listener not responding