8:30 – 4:30 VISIBILITY(?)
- Working on Applet stuff
- More pages that cover Javascript/HTML/Java communication: http://www.raditha.com/java/javascript.php
- It turns out that browsers call applets in unique ways, something that surprises none of you reading this. There is a Java tool, called htmlconverter.jar that comes with the 1.5 (and greater?) jdk. More info is here: http://docs.oracle.com/javase/1.5.0/docs/guide/plugin/developer_guide/html_converter_more.html
- Going to try to run two applets inside the same web page and make sure that the canvas is allocated correctly.
- Looks like communication from JS to Java is handled through AppletLoader.getApplet(). Java to JavaScript is handled normally. http://lwjgl.org/forum/index.php?topic=3266.0
- More on communication, from the LWJGL website: http://www.lwjgl.org/wiki/index.php?title=Deploying_with_the_LWJGL_Applet_Loader_4_-_Polish_and_Tweaks
- Added my JavaScript color button. Events are working and I think it’s vanilla that it will work on all browsers? Yup. So far…
- Running the two applet webpage on fgmdev here: http://fgmdev.com:8080/lwjgl/twoApplets.html. It took one refresh to get everything working in Firefox, but Chrome and IE worked just fine. If you try this in your browser, let me know how it works in the comments section. Focus works too. If you click in the applet, you can move the rotating square with the arrow keys.
- Sending a string from JavaScript to the spinning quad via the LWJGL Appletloader:
- document.getElementById(‘myApplet’).getApplet().setColor(colorStr)
- Working on communicating with JavaScript from the applet.
- Doing this with Maven: http://rostislav-matl.blogspot.com/2011/10/java-applets-building-with-maven.html
- Had to point the buildpath at plugin.jar, which was in my Java jre/lib directory. It’s not in Maven. If this all works, I’ll add it to our local repo.
- Got it. You can call a JS function or an element in the document. Kinda cool, actually. This turned out to be the most useful link: http://www.codeproject.com/KB/scripting/javatojs.aspx. You can play with the running code here.
- Cool pix for the day – multiple applets running in all browsers:

