Solved

java applets gone crazy

Posted on 1998-02-05
4
195 Views
Last Modified: 2013-11-23
Dear experts

Java has been  acting weird lately;
I am using "visual cafee 2 pro" and "applet marque wizard"as visual tools to develop my applets,so that i don't have to write  a single line of
code..I always make sure that the applets are
in the same directories as the html files, with " code" tag pointing to them.

  I haven't been  able to run a single applet lately(neither on my hard disk nor on the server).I keep getting these error messages:

java.lang.null pointer exception.
or
error javalang no such method.

  Finaly i tried to write my own applet code .I have installed jdk1.1.3 to compile them .I keep getting an error message such as "error......threads"

I have a pentium 200 MMX with 32 meg of edo ram and i am using win95.

Do you think  the problem is caused by the mmx tecknology or something else?
Beside copying the applet class file to the same html file folder,should i copy all  the folders containing class files  (when using symantec visual caffe )
into the same folder as the html file.

Thank you.
Fadi
0
Comment
Question by:fadih
  • 3
4 Comments
 
LVL 1

Accepted Solution

by:
froderik earned 120 total points
ID: 1232890
Since you didn't post any code the answers must become general.

MMX shouldn't cause any problems related to Java.

Class files. You will need to copy all class files that your applet uses into the same directory unless the classes are from the standard set of Java classes. (From packages like java.lang and java.io , anything that starts with java normally is supported by the applet browser.) To find out this just check the beginning of your applet code. The import statements tells you which classes the applet needs. (It can't use classes if they are not imported.) My guess is that this is your problem.

java.lang.NullPointerException is thrown whenever you send a method to an object that is null. There is some logical inconsisteny that you must find and do something about. Most probable is that you have forgotten a "new" statement somewhere.

"No such method." Are you getting this message when running the applet? You should get it when compiling the applet. The compiler checks if every method used really exists in the corresponding class.

Error...threads. This kind of message usually means that you haven't set your CLASSPATH correct. It should point to <your_java_dir>\lib\classes.zip to include the standard classes. If it doesn't, nothing will work.

For more specific help I would need your applet code. I would be glad to answer any further related questions.

hope this help
Fredrik
0
 

Author Comment

by:fadih
ID: 1232891
Thank you .Your answer has clarified many things but few
things remain unclear;

1)the "error.....threads" thing.I have the classpath set as you
said but the error still appear.

2)About java.lang.NullPointerException error;you said that is caused by a method being sent to a null... But the code is writen completely by "symantec visual caffe , "applet fx"
and other visual java development tools.How can the code be
wrong?
0
 
LVL 1

Expert Comment

by:froderik
ID: 1232892
1) I suppose the error message says something more than that. It is hard to say anything concrete about error....threads. Could you recreate such a message?

2) Programmers of Java tools make mistakes as well as you and I. That is the problem with using tools. It is hard to find the errors when they occurr for they are almost always quite sofisticated. (Errors that didn't show when they tested the tool.)
0
 
LVL 1

Expert Comment

by:froderik
ID: 1232893
The following are the explanation of NullPointerException in Suns documentation for JDK 1.1.5:

Thrown when an application attempts to use null in a case where an object is required. These include:

*     Calling the instance method of a null object.
*     Accessing or modifying the field of a null object.
*     Taking the length of null as if it were an array.
*     Accessing or modifying the slots of null as if it were an array.
*     Throwing null as if it were a Throwable value.

Applications should throw instances of this class to indicate other illegal uses of the null object.

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now