Docsity

Java Applets: Common Problems and Solutions, Slides of Java Programming

Partial preview of the text

Download Java Applets: Common Problems and Solutions and more Slides Java Programming in PDF only on Docsity!

If your Java applet does not run

Problems with applets?

• Many students face problems while running

Applets from AFS.

• some of the common Problems are…

  • Applet Not initiated
  • Applet loading Failed
  • Source not found.

Failed Loading

The most common problem you see….

This means your applet failed!

Files in Same Folder?

  • Did you keep the class files and html document containing the class file in same folder?
  • If you don’t have them in the same folder, it is harder to write the code to get them to load. (It can be done.)

Ex :

Use single folder to store all related files as above

NetBeans or Eclipse Setup

  • When you see your applet running on Laptop

and it doesn’t run on the Web, especially if you are using Eclipse or Netbeans, declare all the classes in the default package. Do not use a package name.

Runningapplet will work on web

This HelloWorld Applet is harder to transfer to Web

Small changes in file names

  • Another common mistake is to use different case

for the class name in your html code. Ex: If HelloWorld.Class is the class file and you misprint it as Helloworld.class in html code then applet can not find the source and fails to run.

Check the “W” HelloWorld, Helloworld, and helloworld are three different names to Unix and most browsers, although they are the same name to Windows and Internet Exploder.

Key resource: Web Board

 If there are any other problems other than these,

Please post them on Web Board. This will help you

and others.

Web Board’s Tech support can be life saver at the

last minute before exams & project due dates.

Source of information

• My personal experience from doing Java

homework in CIS 602—Prashanth

Sanagavarapu.