How to pick and choose between display monitors?

Hi guys:
I have a multi-display system. How to choose between monitors?
For example, I’d like to use monitor 1 to display the game, monitor 2 for ordinary windows like interfaces, monitor 3 for JME ide.

Is this even possible ?

I ran into the problem when I got a second monitor, the first solution I thought of that works is to run the game on your primary monitor and run the JME ide (and anything else) on the secondary and any other monitors

I may be wrong but I think most programs will start up on the primary monitor unless the program saves your screen preference settings when you close the program. Maybe there’s a setting in the SDK to choose a launch screen, but as an alternative solution I just make sure to go in my device’s display settings and assign the monitor I want to run the game on as my primary monitor, and put my other programs on the others.

This depends on the os. Kubuntu, for example, opens any new window on the same display as the currently focused application.
For Windows I heared of some tools which automatically move the Windows to your liking.

Jme itself might not expose the Display Choice one would have with lwjgl, certainly not with lwjgl2 i think.

But I Open my game in a 720p Window, so i can drag it around, dont have that Problem when Switching applications and it saves power

If you are not using fullscreen, you could do the following:

    import org.lwjgl.opengl.Display;

    Display.setLocation(screenX, screenY);

where screenX,screeny is the offset in pixels from your current primary monitor

That would be if your secondary extends your desktop. Monitors have various setups so would need managing accordingly.

I do this for work all the time. Main monitor is what I’m working on now, left monitor is my emails, right monitor (the one attached to the laptop) is used for YouTube/Music/Video Conferences.

In Windows you can select which monitor is your primary one but some applications will ignore this entirely. The nice thing about games though is that in general they’ll just start on which monitor you have labeled as the primary monitor. Gotcha on it though is that your mouse might not be able to leave the game window since it’s tied to that game. You can alt+tab out of it… but many games don’t handle this well.

If you’re using Windows I suggest looking into either this app: Actual Multiple Monitors: Extended Taskbar with Support of All Windows 7 Features on Each Display. (or something similar)

What that app does is kinda magical. Windows will only show a task bar on your primary monitor. That app will extend it across all monitors, handle different background images for each monitor, create new hot keys/hot zones, etc etc etc. I’ve been using it for 7ish years now. So much better having a task bar that shows you what is open on a particular monitor instead of 1 taskbar with all the apps piled up.

Thank you but my question is :slight_smile:
How can I choose display monitor in my program ?
I’m not talking about OS setting.

Huh… I was about to write that that’s impossible thanks to the OS itself… Buuuuuuuuuuut I decided to look around and wouldya look at this? java - Show JFrame in a specific screen in dual monitor configuration - Stack Overflow This might work… Let us know if it does.

Note that that StackOverflow discussion refers to using GraphicsEnvironment, which is an AWT class. As such, if you’re using LWJGL3 as your OpenGL layer you’re likely to have issues (especially on OSX).

1 Like