Access to underlying wingow

Simple question which I hope has simple answer. If I create a non-fullscreen JMonkey window



display.createWindow( 640, 480, properties.getDepth(), properties.getFreq(), false );



Is there anyway I can access the underlying window (the JFrame). I'd like to move the window slightly to the left automatically.

Thanks,

Alex

This is such a hack, which is probably why I like it so much :slight_smile: Anyways, if you are using LWJGL, you can use the LWJGL command directly.


Display.setLocation(0, 0);



My question would probably be then, is there a more JMonkey/clean way of doing this?

Thanks

Well, its a hack, so it had to have a problem. If I use the LWJGL Display.setLocation, I can only use it after I call createWindow, but before the window is actually initialize. Otherwise, everything hangs. Oh well …



Just means I need a better long term solution :slight_smile:

DisplaySystem.getDisplaySystem().moveWindowTo( x, y );


works fine here...

Container dialog = KeyboardFocusManager.getCurrentKeyboardFocusManager().getCurrentFocusCycleRoot();


Should give you the frame (or at least the gfx panel, which you could in turn use to find the frame its on...)

Although I am wondering why it hangs...

LWJGL creates a native window on linux & win32 so you can't find it with the focus manager thing. Using

DisplaySystem.getDisplaySystem().moveWindowTo( x, y );

should work fine as long as you call it after the display is created.

LWJGL creates a native window on linux & win32


I guess that explains why it works on mac