0

I am using multiple monitors, before I open popup from main window I need to check the main window is currently active(opened) on which monitor. How can check in JavaFx.

Darshan
  • 35
  • 5
  • 1
    Maybe [this post](https://stackoverflow.com/questions/34936617/choose-which-monitor-does-a-javafx-window-open-in) can help. – Tobias Nov 20 '19 at 12:32

1 Answers1

1

Use Screens.getScreensForRectangle. Using the bounds of your window you should be able to get a list of the screens used to display it's area:

List<Screen> windowScreens = Screens.getScreensForRectangle(window.getX(), window.getY(),
                                                            window.getWidth(), window.getHeight());
fabian
  • 80,457
  • 12
  • 86
  • 114