Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Panic about an Applet for a simple diner menu

 
scott schlesinger
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having some major runtime issues with this code and have been experiencing huge headaches over this code and this forum has been popping up repeatedly when I have been trying to fix it. The problems I am experiencing are finally limited to runtime errors, but it seems to be generated by my loops. The errors I am getting are as follows:

java.lang.NullPointerException
at MyMenu.init(MyMenu.java:65)
at sun.applet.AppletPanel.run(AppletPanel.java434)
at java.lang.Thread.run(Thread.java:722)

As you can see, below the error is related to an initialization loop I have.

at this time I have spent nearly 2.5 weeks trying to fix this program, I am just desperate to hear that it something simple and I will not have to start all over again =(

 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you have all of these

each one needs a corresponding
= new Component();

e.g.
title = new JLabel();

go through your code and make sure they're there, if not add them
 
Darryl Burke
Bartender
Posts: 5149
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Creating an array doesn't populate it; each array element has its default value -- 0 for numeric primitives, false for boolean and null for reference types.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic