Skip to content

Commit 548eb80

Browse files
hansonrhansonr
authored andcommitted
3.2.2.04 adds support for window-level applets, such as JmolApplet
top-level objects are given "_" as a package name, but are also accessible from JavaScript by their given name. For example code:"JmolApplet" becomes code: "_.JmolApplet"
1 parent 585b95c commit 548eb80

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
1.42 KB
Binary file not shown.

sources/net.sf.j2s.java.core/srcjs/swingjs2.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12949,7 +12949,17 @@ if (!J2S._version)
1294912949
try {
1295012950
var clazz = (applet.__Info.main || applet.__Info.code);
1295112951
try {
12952+
if (clazz.indexOf(".") < 0) {
12953+
clazz = "_." + clazz;
12954+
if (applet.__Info.main)
12955+
applet.__Info.main = clazz;
12956+
else
12957+
applet.__Info.code = clazz;
12958+
}
12959+
1295212960
var cl = Clazz.load(clazz);
12961+
if (clazz.indexOf("_.") == 0)
12962+
window[clazz.substring(2)] = cl;
1295312963
if (applet.__Info.main && cl.j2sHeadless)
1295412964
applet.__Info.headless = true;
1295512965
} catch (e) {

0 commit comments

Comments
 (0)