Twitter Delicious Facebook Digg Stumbleupon Favorites More

Thursday 6 October 2011

Add java applets in your blogger blog

ADD JAVA APPLETS IN YOUR BLOG

Hello reader if you are here it means you want to add some java applets in your blog post, if you have your domain its not a big deal for you to add java applets in your blog but if you are using some blog services like blogger which I am using you feel lots of problems because you do not have a directory to save java files over there, so you have to fetch java applets from other directories or another sites which is useful for your blog post. Here I am writing step by step process to add JAVA APPLETS into your blog.

Here it a code snippet:
<applet code="GatesApplet.class" codebase="http://www.chem.uoa.gr/applets/appletgates/" height="370" width="480">

here code="xxxxxxxxxxx" denotes the class which is the class file for the applet
here codebase= "xxxxxxxxxxxxx" denotes the directory where this applet is stored 
so if you are adding an applet or you can say fetching an app from a page you must find its class file and the directory where that applet is stored.
it means you have to know the codebase i.e the directory and code that is class file of that applet.
another thing is that the some times JAVA applets are stored in a archive file so in these case this code will work.
<applet archive="http://www.wireless-earth.de/applets/GDI/gatesim.jar" code="volladdierer.class" height="600" width="430"></applet></div>


this is another type of code in which applet is stored in a archive file hence you should first find that archive and then the whole code work like the last

one.

now here question arises how to how to find the archive, code or codebase for a perticular JAVA applet.
simple solution is that check the source file of that page using CTRL+U in your browser and then check for the code which is just similar to the code snippets given here and you are done.
Here the first snippet is the real code which i have used in blog post which is for digital logic gates.

2 comments:

Java Program and Source Code said...

I would like to ask where did you host or what file hosting site did you saved your .jar file and .class files?

Is it really necessary to have .jar file to run the applet?


http://java-program-sample.blogspot.com

vasu naman said...

yes as my post tells that if you want to add java applets then you must save your file in .class (i.e in compiled form ) or in .jar form to add any applet.

Post a Comment

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Blogger Templates