The Artima Developer Community
Sponsored Link

Java Answers Forum
java applets and HTML

1 reply on 1 page. Most recent reply: Apr 3, 2002 8:04 PM by Kishori Sharan

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Julie

Posts: 13
Nickname: champ
Registered: Mar, 2002

java applets and HTML Posted: Apr 3, 2002 7:46 PM
Reply to this message Reply
Advertisement
I am just learning Java and am currently going over applets. I understand the <applet> tage but how do I get my computer to compile the html code? and when I do how do I save it as a HTML file to call up to a web page? I know this is a basic question but I am having trouble finding an answer.
thanks


Kishori Sharan

Posts: 211
Nickname: kishori
Registered: Feb, 2002

Re: java applets and HTML Posted: Apr 3, 2002 8:04 PM
Reply to this message Reply
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

Flat View: This topic has 1 reply on 1 page
Topic: JTabbedPane.. Previous Topic   Next Topic Topic: saving objects on a file

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use