|
Re: java applets and HTML
|
Posted: Apr 3, 2002 8:04 PM
|
|
You have to do the following things in order to see your applet in your browser. 1. Write an applet in java and compile it using javac compiler. As you are learning Java, you already know how to compile a java class. This way you have a class file for your applet. 2. Now, open a text editor, maybe notepad if you are using Windows. 3. Type the applet tag and the CODE attribute of your applet tag will take the class name you developed in STEP 1. In CODE attribute give only class file name and not full path. For example, CODE="myapplet.class" and not CODE="c:\julie\myapplet.class" 4. Save this file with extension html. while saving the file you can just put all file name in quotes as "myapplet.html" 5. Open the myapplet.html file in browser, or just double click it in windows explorer. It will show your applet. 6. You never compile an HTML file. It is a text file. YOu only compile your Java class in this case. 7. To simplify the process, place html file and your Java class file in same folder. Also, don't place your Java applet class in any package. 8. Once you are expert in handling Applet and html then you can ignore STEP 7.
Good luck...
Thanks Kishori
|
|