Forum Stats

  • 3,837,916 Users
  • 2,262,307 Discussions


javafx with multiple monitors

awacs5 Member Posts: 17
edited Apr 23, 2017 8:30PM in JavaFX 2.0 and Later


I'm trying to see if javafx can start a new stage on each screen. Basically the computer has multiple monitors.

I used the Screen.getScreens() call to get a list of screens. But how do I set the stages to use these screens?

The getBounds() method of the screens are all of the same dimensions. The computer is linux based and so the desktop screens are not extended but separate.

With awt graphics I can get the offsets with multiple monitors when the desktop is extended but with javafx all the examples I find people just use the primary screen.

So does anyone know how to set a stage on a separate screen (not extended desktop)



  • jsmith
    jsmith Member Posts: 2,856
    edited Apr 21, 2017 7:06PM

    If the Screens class doesn't do it for you, nothing else in the JavaFX library will.

    You might have to resort to calling some awt code from your JavaFX app to or calling out to native code to get the info you desire.  I don't have any info on how to perform either of those tasks.

  • bouye-JavaNet
    bouye-JavaNet Member Posts: 394 Silver Badge
    edited Apr 23, 2017 8:30PM

    Also check the OpenJDK's bug system to see if something similar has already been reported for JavaFX and, if needed, report this to the Java Bug page as a request for enhancement.

    I am not sure if this has been already discussed for JDK9 on the mailing list, so if no similar issue has been opened already you may not have any quick fix anytime soon and you will have to resort calling AWT code or finding some native function that would allow you to move your stage to other screens.

This discussion has been closed.