my dog learned polymorphism*
The moose likes Applets and the fly likes Panic about an Applet for a simple diner menu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Panic about an Applet for a simple diner menu" Watch "Panic about an Applet for a simple diner menu" New topic
Author

Panic about an Applet for a simple diner menu

scott schlesinger
Greenhorn

Joined: May 08, 2012
Posts: 1
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

Joined: Jun 09, 2003
Posts: 4632
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

Joined: May 03, 2008
Posts: 4523
    
    5

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.


luck, db
There are no new questions, but there may be new answers.
 
 
subject: Panic about an Applet for a simple diner menu
 
Similar Threads
Help with getting program to compile.
FlowLayout issue
GridBagLayout
Apply 2d array of answer to the right position of JTextField grid with JCheckBox
Please tell me how to display value on Y axis in this code