Calling Java applet functions via JavaScript in OS X (IE, Firebird)

ugh

Platinum Member
Feb 6, 2000
2,563
0
0
Hi folks,

Been trying to perform the aforementioned task in OS X and somehow neither IE (5.2.2) nor Firebird (one of the latest nightlies) can do it. I've also installed JDK 1.4.1 on OS X. The applet loads fine in the page as well. I've tried the exact same code in Windows with IE6 and Firebird and it works perfectly fine.

Anyone has experience in this?


Thanks.
 

ugh

Platinum Member
Feb 6, 2000
2,563
0
0
TestApp.java

import java.applet.*;
import java.awt.*;
import java.util.*;

public class TestApp extends Applet {
public void init() {
this.setLayout(new FlowLayout(FlowLayout.CENTER, 10, 10));
this.setBackground(new Color(255, 200, 0));

}

public String getVersion() {
return System.getProperty("java.version");
}

public String getVendor() {
return System.getProperty("java.vendor");
}

public void paint(Graphics g) {
g.drawString("hello world!", 5, 10);
}

}


Test.html

<html>
<body>

<script language="javascript">

function doIt(val) {
if (val == "version") {
alert("Version: " + document.TestApp.getVersion());
} else if (val == "vendor") {
alert("Vendor: " + document.TestApp.getVendor());
} else {
alert(val);
}
}
</script>


<a href="javascript:DoIt('version')">Version</a>

<a href="javascript:DoIt('vendor')">Vendor</a>

<a href="javascript:DoIt('blah')">Version</a>


<applet name="TestApp" height="100" width="100" code="TestApp.class" codebase=".">
</applet>

</body>

</html>
 

ugh

Platinum Member
Feb 6, 2000
2,563
0
0
MrChad: Thanks for the info. Darn, I guess there's no way to get my application to work on Mac :(