Solved

java applets gone crazy

Posted on 1998-02-05
4
200 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how to debug htl and js pages 8 80
swing controls 2 37
wild fly 8 startup error 2 82
restrict decimal places for double datatype 10 49
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

751 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