• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NullPtrException when reading JTextField

 
Antony Amicone
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
recipeNameField is never created
 
Antony Amicone
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i create it there

 
Antony Amicone
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and i added another modifier

 
fred rosenberger
lowercase baba
Bartender
Posts: 12186
34
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Antony Amicone
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
looool i was tired, stupid error ty a lot
i solved
 
Rob Spoor
Sheriff
Pie
Posts: 20610
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Next time please limit your code to an SSCCE. With this amount of code I didn't even bother looking at it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic