Fixed multiple windows on Java side + bugfixes

Also included java methods for setting position and size of the windows.