• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 461
  • Last Modified:

problem on Applets

I have tried to code applets but i cant see the output though i provided an HTML file for it. I was able to use the appletviewer directive but i still can't be able to see the result. How do i deal with this? give me pls the complete tip. (Are there possibilities of incompatibilities? Im using Windows 98 and JDK 1.3.....)
0
malignant
Asked:
malignant
1 Solution
 
Mayank SAssociate Director - Product EngineeringCommented:
No, there are no incompatibilities between Windows 98 and JDK 1.3. Java has been made to be platform-independent, right? You might try these:

1. Remove the HTML file and put the following comment in your source-code:

// I'm assuming that the source-file is AppletDemo.java

/*
<applet code = "AppletDemo" width = 800 height = 600>
</applet>
*/

Notice that there need not be a file-extension mentioned in the code parameter "AppletDemo".

After compiling the source code, type the following command:

appletviewer AppletDemo.java

Notice that its invoking the source-file (.java) and not the class-file. Many people make the mistake of typing .class with appletviewer or not giving the extension at all - you must specify the source-file (.java) because that is the one containing the applet-tag which I have written before. Also, make sure that the case of the class-name matches that of the filename and that you specify the name of the file in the correct case while executing the appletviewer command.


2. If you want to keep the HTML file:

Write the same applet tag that I've written above in the HTML file and let's say that the name of the HTML file is AppletDemo.html (make sure that it is .html, and not .htm - even that has created a problem for me before!). Then, type the following command:

appletviewer AppletDemo.html

Otherwise, just open AppletDemo.html from Internet Explorer and your Java Applet will load.

If you still experience problems, then please post a message.

Mayank.

0
 
malignantAuthor Commented:
i have tried it and it worked well

ty mayank....


0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now