3 <title>SwingJS test</title>
5 <meta charset="utf-8" />
6 <!-- breaking out the library for debugging -->
7 <script type="text/javascript" src="jquery/jquery.js"></script>
8 <script type="text/javascript" src="js/JSmoljQueryExt.js"></script>
9 <script type="text/javascript" src="js/JSmolCore.js"></script>
10 <script type="text/javascript" src="js/j2sjmol.js"></script>
11 <script type="text/javascript" src="js/JSmol.js"></script>
12 <script type="text/javascript" src="js/SwingJS.js"></script>
14 <script type="text/javascript">
16 Jmol._checkLoad = true
18 Jmol._isAsync = false;
20 Jmol.getProfile() // records repeat calls to overridden or overloaded Java methods
22 var jmolApplet0; // set up in HTML table, below
24 // use ?_USE=JAVA or _USE=SIGNED or _USE=HTML5
26 jmol_isReady = function(applet) {
27 document.title = (applet._id + " is ready")
28 Jmol._getElement(applet, "appletdiv").style.border="1px solid blue"
33 code: "org.uwi.TanSugd3S",
39 z:{monitorZIndex:100},
40 serverURL: "http://chemapps.stolaf.edu/jmol/jsmol/php/jsmol.php",
44 // jarFile: "JStest.jar",
46 disableJ2SLoadMonitor: false,
47 disableInitialConsole: false,
49 readyFunction: jmol_isReady,
59 "java.text.SimpleDateFormat",
61 alert(new java.text.SimpleDateFormat($("#date").val()).format(new Date))
69 A test page for the SwingJS system.
70 A <a href=https://sourceforge.net/p/swingjs/code/HEAD/tree/trunk/src/org/uwi/TanSugd3S.java>simple JApplet</a>.
71 Status: demo only; limited graphics; controls and layouts are taking shape. Click on the graph.
73 SwingJS.getApplet("testApplet", Info)
75 If this is a simple rectangle with a blue outline, it means that the JApplet loaded successfully.
76 <br>Shown below are comparisons with the Java applet.
77 <!-- info <a href="javascript:testApplet._showInfo(true)">show</a>
78 <a href="javascript:testApplet._showInfo(false)">hide</a>
80 <div style="position:absolute;left:900px;top:30px;width:600px;height:300px;">
81 <div id=sysoutdiv style="border:1px solid green;width:100%;height:95%;overflow:auto"></div>
82 This is System.out. <a href="javascript:testApplet._clearConsole()">clear it</a>
83 Go ahead and open a developer console and type
85 <b> <a href='javascript:System.out.println("Hello, world!")'>System.out.println("Hello, world!")</a></b>
88 <input type=text id=date style="width:200px" value="EEE, d MMM yyyy HH:mm:ss z"> <a href="javascript:dateTest()">SimpleDateFormat test</a>
89 <a href="javascript:alert('The methods listed in the next message are those that are overloaded in such a way -- for example, Color(int r, int g, int b) and Color(float r, float g, float b) -- that make them impossible for Java2Script to differentiate and so must be refactored.'); Clazz.showDuplicates()">Show Duplicates</a>
90 <br> <a href="j2s" target="_blank">Converted Java class directory</a>
93 <img src=javaimage.png />