Ikspeto
Ikspeto

Reputation: 582

Can't load Java applet from another directory in HTML

When i try to load an applet with :

<object type="application/x-java-applet" height="300" width="550">
  <param name="code" value="Sokoban" />
</object>

when the html file is in the same directory as the applet it loads as expected.

But when the applet is in an another directory the following code won't work :

<object type="application/x-java-applet" height="300" width="550">
  <param name="code" value="sokoban/Sokoban" />
</object>

(sokoban is the directory the applet is in, Sokoban is the applet => Sokoban.class)

Upvotes: 0

Views: 485

Answers (1)

Andrew Thompson
Andrew Thompson

Reputation: 168825

  1. Use deployJava.js to deploy the applet (linked from the applet info. page).
  2. Use the codebase attribute to point to the sokoban directory.
  3. Since the code attribute needs to be the fully qualified class name, return it to just Sokoban

Upvotes: 1

Related Questions