Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

java applets gone crazy

Posted on 1998-02-05
4
Medium Priority
?
202 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 480 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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
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.
Suggested Courses

705 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