Get how many monitors are connected.

Kevin Rushforth kevin.rushforth at
Fri Sep 3 14:39:06 UTC 2021

I don't think so. You can find out the primary monitor with 
Screen.getPrimary(), and you can determine the positioning of all 
screens relative to each other using the visual bounds of each screen. 
There isn't any guarantee, though, that the list of screens is ordered, 
so if there are more than 2 screens, I don't know of a reliable way to 
distinguish the second, third, and so on.

-- Kevin

On 9/3/2021 7:06 AM, Davide Perini wrote:
> Hi,
> I'm using this to get how many monitors is connected to the PC:
> for (Screen screen : Screen.getScreens()) {
> }
> Is there a way to know what is the first, second and third monitor?
> Using Windows and I would like to see what is the first monitor set in 
> windows, what's the second and so on.
> Is this possible using JavaFX?
> Thanks
> Davide

More information about the openjfx-dev mailing list