The OSP project has partnered with developers at St. Olaf College to convert OSP Java programs (applets and applications) to JavaScript using the java2script/SwingJS framework developed by Bob Hanson. The SwingJS website contains physics, math, and chemistry conversion examples. They are not "ported" to JavaScript. They are not recreated in JavaScript. The JavaScript "applets" are created in parallel with standard Eclipse-based Java development, along with their Java counterparts. In the end, the original functional of the Java applet or stand-alone application its virtually identical JavaScript counterpart, with all the layout, events, and functionality of the original. One of the most powerful and important features of Java -- reflection (the loading of classes on the fly, only as needed) -- is fully preserved, providing the modularity necessary for complex web application development.
The SwingJS developers maintain a GitHub repository for Java developers who want to convert their Java applets or Java applications to JavaScript, allowing continued, simultaneous one-source development of both Java and JavaScript.
Hanson, R. (2020, February 5). SwingJS: Converting Java Programs to JavaScript. Retrieved March 19, 2025, from https://chemapps.stolaf.edu/swingjs/site/swingjs/examples/index.html
%0 Electronic Source %A Hanson, Robert %D February 5, 2020 %T SwingJS: Converting Java Programs to JavaScript %V 2025 %N 19 March 2025 %8 February 5, 2020 %9 text/html %U https://chemapps.stolaf.edu/swingjs/site/swingjs/examples/index.html
Disclaimer: ComPADRE offers citation styles as a guide only. We cannot offer interpretations about citations as this is an automated procedure. Please refer to the style manuals in the Citation Source Information area for clarifications.