[Solved] Re-position window

Hello,



I know how to recreate the application window, but how can I reposition it?

E.g. when I resize the window from 1024x768  to 1280x1024 the window succesfully gets bigger,

but it's topleft corner stays the same. In this case it means that most of the window is 'outside' the monitor.



Hope that make any sense, so does anybody know how I can set the window the the topleft corner?



Thanks,



Starik

Same problem with me… And I searched the forum for a while now but I didn't find any solution.



Is it really so hard to re-position the JME-Window (let's say from center-position to the lower right corner)? Or maybe I need just a little hint - already looked at JMEDesktop, but I think that won't solve my problem…  ://

See DisplaySystem.moveWindowTo(int x, int y)

Oops… didn't thought that it would be so easy… thx a lot!  :smiley:





and btw… this community/forum-support of jme is just awesome!  :slight_smile:

Call me an idiot, but if I try to use DisplaySystem.moveWindowTo(int x, int y) I get a compile-error because "my" display (in FixedFramerateGame) doesn't know the "moveWindowTo"-command.

I've already tried updating to the newest CVS Version but that didn't change anything… Any ideas?  :smiley:

Okay… your an idiot :stuck_out_tongue:





HaHa, couldn't resist… but seriously, i DO have an answer for you…



try:

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

I know I'm an idiot - so you didn't tell something new to me.  :evil:



I'll try your solution, but I thought I already tried that… but because I'm an idiot I might be wrong.  :wink:




you are both right :slight_smile:



jme 2 (svn) moveWindowTo()

http://code.google.com/p/jmonkeyengine/source/browse/trunk/src/com/jme/system/DisplaySystem.java



jme1 (cvs) no moveWindowTo()

https://jme.dev.java.net/source/browse/jme/src/com/jme/system/DisplaySystem.java?rev=1.67&view=markup





i'd suggest switching to jme2

actually THAT might solve the problem…  XD

hmmm, I didn't even know that jME 1.0 didn't support that…

jME2 actually has quite a lot of new stuff "under the hood"  ;), hence why it is called jME2 and not jME1.01…

Actually, and I might be wrong here, I think that its only acceptable practice to have subversions of applications that are 'compatible'; ergo the implementation of all the enums (and all the other changes w/o a keeping the old obsolete stuff for backwards compatibility) kinda forces the version number increment…



But yes, all the new features are a definitely a bonus to the upgrade :slight_smile:

How do I reposition the window in JME3?

@ivanschuetz said:
How do I reposition the window in JME3?

Like any other window you grab the top bar by clicking and holding the mouse button and then drag it around.

I mean with code.



Something like DisplaySystem.moveWindowTo(int x, int y) ?

I mean something like DisplaySystem.moveWindowTo(int x, int y) ?

Sorry to necro this thread, but seems like the guy never got an answer.

And now I have a player that’s using Windows 10 DPI scaling to enlarge his borderless game window and for some paranormal reason it’s not centered.

Since that’s likely some random windows bug, the only workaround would be to let him reposition it manually, but for that I kind of need the code for it as the bar is hidden in borderless mode (duh).

I’ve searched the engine source a bit but I can’t really find any references to any window movement at all, though it may be just github’s crap search and DisplaySystem no longer exists as a class.

Is this even possible in jme 3(.1)?

I guess jme does not provide an API. If there is something, try lwjgls Display classes

1 Like

Ah yes, thank you! If anyone else needs it:

Display.setLocation(x, y);

It’s actually rather neat for work as well I’ve just found out. No moving the window slightly up and to the left every damn time I start it up to debug a tiny change :smile:

3 Likes

Thank you!

I was looking for this feature too…such a nightmare to reorganize windows each debug launch between my 3 screens :’(

1 Like