fancy
fancy

Reputation: 2149

Java Applet works in Firefox only

I have implemented a Java Applet. I have exported the jar. I signed the jar. And it works if I put it on my server and use it with HTML. But only in Firefox.

Here is the HTML:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html
  PUBLIC "//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Upload Test</title>
</head>
<body>
    <object archive="applet.jar" classid="java:uploader/FileUpload.class"
    codetype="application/java-vm" width="800" height="600"> </object>

</body>
</html>

I also tried it with this:

<SCRIPT type="text/javascript">
if(browser.value.getIndex("chrome") {
  chrome.browser.enableFeature(JApplet)
});
</SCRIPT>

But still Firefox only. I would really like for this to work in Chrome & IE9. But these two only leave a space where the Applet should be. I can even highlight it.

Are there things I have to add in my xhtml? Or maybe something in the Applet?

I found enough online about why Applets might not work, but nothing about why Firefox only.

Upvotes: 1

Views: 383

Answers (1)

fancy
fancy

Reputation: 2149

As Andrew Thompson said, I need to use deployJava.js. You can find it in this Oracle tutorial. This tutorial describes in detail every step neccessary.

Now my Applet works on all three browsers (FF, Chrome, IE9) like a charm.

Thanks!

Upvotes: 1

Related Questions