Change Display Used for Eclipse Launches

I’m developing a Swing-based Java application in Eclipse on Windows XP. I have a dual monitor setup.

I want to have the program launch on a different monitor than the one I’m running Eclipse in. How can I set up my Debug Configuration to make this happen?

Answer

When a new frame is opened, it defaults to coordinates 0,0. Exactly where this is depends on your operating system’s monitor layout. Typically, 0,0 will be the upper-left corner of the primary monitor.

The solution to your problem is to run Eclipse on your secondary monitor, so that the applications will open on the other (primary) monitor. You don’t actually have to move Eclipse to do this. Go into your operating system’s monitor settings and switch the primary monitor to the monitor you wish to start the application on. Eclipse will now be running on the secondary monitor.

Your new frame will now be opened on the other monitor, and you have changed no code in the process, just your operating system’s configuration settings.

Leave a Reply

Your email address will not be published. Required fields are marked *