Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Klarissa Schmidt   on Nov 22 In Java Category.

  
Question Answered By: Angelica Ramos   on Nov 22

To run your applet  in a Java-enabled browser, you need to compile your code and then create an HTML file in which you use <APPLET> tag to launch java applets.

for example
<APPLET CODE="AppletSubclass.class" width=300 height=200>
</APPLET>
this tag tells the browser to load the applet whose Applet subclass is named AppletSubclass and the applet class is relative to the html fle that contains the <applet> tag.( ie. its class file is in the same directory as the html file)

if you put the applet's files somewhere else ( not at the same directory as the html file) use the CODEBASE attribute to tell the browser in which directory the applet's files are located.

<APPLET CODE="AppletSubclass.class" CODEBASE="someDirectory/" width=300 height=200>
</APPLET>

Share: 

 

This Question has 5 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Applet Or get search suggestion and latest updates.


Tagged: