diff --git a/runtime/classes.jar b/runtime/classes.jar deleted file mode 100644 index 02a0625..0000000 Binary files a/runtime/classes.jar and /dev/null differ diff --git a/runtime/foo.class b/runtime/foo.class index bf77054..c396eee 100644 Binary files a/runtime/foo.class and b/runtime/foo.class differ diff --git a/runtime/foo.java b/runtime/foo.java index 5604091..1473dc3 100644 --- a/runtime/foo.java +++ b/runtime/foo.java @@ -1,7 +1,10 @@ + +import bicavm.browser.Window; + public class foo{ public static void main(String[] args){ - String hello = "hello"; - String world = "world"; - String together = hello + world; + String hello = "bicavm"; + String world = "changed this title"; + Window.setTitle(hello + world); } } \ No newline at end of file diff --git a/src/internalJNI.jsh b/src/internalJNI.jsh index 05e841a..8407996 100644 --- a/src/internalJNI.jsh +++ b/src/internalJNI.jsh @@ -30,5 +30,8 @@ }, 'java.lang.Double' : { 'method doubleToRawLongBits(D)J' : java_lang_Double_doubleToRawLongBits + }, + 'bicavm.browser.Window' : { + 'method setTitle(Ljava/lang/String;)V' : bicavm_browser_Window_setTitle } } \ No newline at end of file diff --git a/src/javaNativeInterface.js b/src/javaNativeInterface.js index 73b44ed..ae759a7 100644 --- a/src/javaNativeInterface.js +++ b/src/javaNativeInterface.js @@ -44,9 +44,14 @@ function java_lang_Float_floatToRawIntBits(f){ } //java.lang.Double doubleToRawLongBits(D)J - function java_lang_Double_doubleToRawLongBits(d){ +function java_lang_Double_doubleToRawLongBits(d){ var x = new ArrayBuffer(32); new Float64Array(x,0)[0] = d; var y = new Int32Array(x,0); return new math.Long(y[0],y[1]); -} \ No newline at end of file +} + +function bicavm_browser_Window_setLocation(s){ + window.document.title = javaString2JS(s); +} +