Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.SetFormStyle("UNDECORATED")
MainForm.Show
asJO(Me).RunMethod("makeA4Page",Array(MainForm))
End Sub
Sub asJO(o As JavaObject)As JavaObject
Return o
End Sub
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub
#if java
import javafx.stage.Stage;
public static void makeA4Page(anywheresoftware.b4j.objects.Form s){
Double dpi = javafx.stage.Screen.getPrimary().getDpi();
Double dpmm = dpi/25.4;
s.setWindowHeight(297 * dpmm);
s.setWindowWidth(210 * dpmm);
}
#End If