Harry Kitchener
Harry Kitchener

Reputation: 265

How do I get my application to appear on the center of my second monitor, not my main?

I am trying to get my application to appear on the center of the second monitor as my main monitor has the code on. I am using window.setLocationRelativeTo(null);, but do not know what I would use to place it on the other monitor. How can I get my application to appear on the second monitor?

Upvotes: 1

Views: 46

Answers (1)

Levenal
Levenal

Reputation: 3806

Using GraphicsEnvironment and GraphicsDevice class's seems to be the way to go for this. By obtaining the environment you can check for GraphicsDevices such as screens and then place your frame on the relevant device if found. If you look at this question here there are several answers which should be able to provide you with what you want.

Good Luck!

Upvotes: 1

Related Questions