Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can javafx application display different stages on different monitors?

Tags:

The idea is to have one app displaying two diferent windows (Stages) one on each monitor, the app should know how many monitors the computer has and their resolution.

It is possible with javafx?

like image 874
Herme Avatar asked Jul 24 '09 20:07

Herme


People also ask

What method is invoked to display a stage in JavaFX?

Showing a Stage The difference between the JavaFX Stage methods show() and showAndWait() is, that show() makes the Stage visible and the exits the show() method immediately, whereas the showAndWait() shows the Stage object and then blocks (stays inside the showAndWait() method) until the Stage is closed.

What is primary stage in JavaFX?

The JavaFX Stage class is the top level JavaFX container. The primary Stage is constructed by the platform. Additional Stage objects may be constructed by the application. Stage objects must be constructed and modified on the JavaFX Application Thread.

What class represents the window in a JavaFX application?

Stage. A stage (a window) contains all the objects of a JavaFX application. It is represented by Stage class of the package javafx. stage.


1 Answers

For the current version of JavaFX (2.2) you can use this:

Screen.getScreens()

That will give you an observable list of Screen objects.

See the Screen javadoc page here: http://docs.oracle.com/javafx/2/api/javafx/stage/Screen.html

like image 104
Geert Schuring Avatar answered Oct 11 '22 17:10

Geert Schuring