Dong Shin 01.13.2012

  • LoadApplet GWT Application
    • http://www.fgmdev.com:8080/LoadApplet/LoadApplet.html
    • loads Java Applet specified in the main
    • uses JSNI to communicate with the Applet
    • Test3DApplet.java has examples of calling Applet’s methods and specifying the callback from the Applet
      • public native void setColor(String color) /*-{
        $wnd.document.getElementById(“myApplet”).getApplet().setColor(color);
        }-*/;

        public native void getFramerate(Test3DApplet x) /*-{
        $wnd.showFrameRate = function(frameRateStr) {
        x.@com.fgm.loadApplet.client.applet.Test3DApplet::showFrameRate(Ljava/lang/String;)(frameRateStr);
        }
        //        $wnd.showFrameRate(“01000”);
        $wnd.document.getElementById(‘myApplet’).getApplet().getFrameRate(
        “showFrameRate”);
        }-*/;

        public void showFrameRate(String frameRateStr) {
        GWT.log(“frameRate: ” + frameRateStr);
        frameLabel.setText(“Framerate: ” + frameRateStr);
        }

    • checked into /Sandbox_folders/DONG_SANDBOX/LoadApplet