How do install a java applet like the one you have on your homepage? ( i.e. Lake Applet )
I installed my Java Applet properly but it still says it's not working. What am i doing wrong?
How do install a java applet like the one you have on your homepage? ( i.e. Lake Applet )To have a Java applet on your homepage, you must somehow get hold of the class file for the applet. A class file is basically the file that works the whole applet, without it the applet won't work. Class files are encoded programming instructions that basically tells the applet what to do, you can't edit or change any of the instructions within the class file unless you are a Java expert. =)
For this case, the Lake applet uses a class file called the ' Lake class '. Place the class file in the same directory as the page which you intend to have this applet on. ( this is done for simplicity sake. ) Once you have done so, you have to place in the HTML codes which would reference the class file. The HTML code for the Lake class is shown below:
<CENTER><APPLET codebase="/SouthBeach/Jetty/2852/" code="Lake.class" id="Lake" width="410" height="150"><PARAM name="image" value="/SouthBeach/Jetty/2852/sbbanner2.jpg"></CENTER>
</APPLET>This HTML code references my Lake class file that I have on my server space here in geocities. The codebase parameter tells you that. As for the image that is used in the applet, look at the second part of the code which says image. The value references the image from the my server space in geocities. I placed an image file called sbbanner2.jpg in my server space which is why the code is able to reference it. Note, you don't have to display this image in any of your web pages, just place in the server and the applet will do the displaying for you.
If you are unable to get hold of the Lake class file, you can also reference it to the site you found it from. ( Please note, this can only be done with the owner's permission, it would be illegal otherwise! )This is done by changing the codebase URL to the site you found it from. Change the reference for the " image " so it shows your image which you intended but change the codebase URL to the site you found it from. This way, the code references the site that has the lake class but it references the image in your web space. Do also note, you can change the dimensions of the applet to whatever you want.so i'll leave it up to your own discretion on what to type in there.
I installed my Java Applet properly but it still says it's not working. What am i doing wrong?
When this happens, you have to check the following fault finders.
If any of the answers is NO than that would be the reason why it is not working. Through my experience with Java, I sometimes run into these problems even when my codes and all are right. I realised that sometimes the browser does not launch it's Java viewing capabilities properly and as a result, i would have to shut down the browser and open it up again. When all else fails, try that, it worked most of the time for me.
- Is my class file in the same directory? OR Did I reference the right URL for the class file?
- Is the HTML code written correctly?
- Is my browser Java supported?
|
|
|
|
|
|