This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes NullPtrException when reading JTextField Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "NullPtrException when reading JTextField" Watch "NullPtrException when reading JTextField" New topic
Author

NullPtrException when reading JTextField

Antony Amicone
Ranch Hand

Joined: Mar 11, 2006
Posts: 125
i have a jtextfield, and when i press a button, i should have a print that show me the value inserted in the textfield, but it doesnt run.

David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

recipeNameField is never created
Antony Amicone
Ranch Hand

Joined: Mar 11, 2006
Posts: 125
i create it there

Antony Amicone
Ranch Hand

Joined: Mar 11, 2006
Posts: 125
and i added another modifier

fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 9947
    
    6

do you really expect someone to go through your almost 600 lines of code? And as Dave said, you never create recipeNameField. The ONLY place I see it is on line 112 of your TbEvent class in the "public TbEvent(JButton t1, JTextField tf1, JComboBox tf2, JSlider tf3, JSpinner tf4, JSpinner tf5)" constructor...but it's never declared anywhere.


Never ascribe to malice that which can be adequately explained by stupidity.
Antony Amicone
Ranch Hand

Joined: Mar 11, 2006
Posts: 125
looool i was tired, stupid error ty a lot
i solved
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

Next time please limit your code to an SSCCE. With this amount of code I didn't even bother looking at it.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: NullPtrException when reading JTextField
 
Similar Threads
Dialogs
Jtable and database results
Problem with "abstract class
problem with insert and select
Desktop.Action.EMAIL