I was writing java FX application. I have two monitors connected into one PC. I wanted to open application in the second window monitor. somehow I managed to do it with vbox not loading inside of them components. But when I try to load my fxml view into Parent it dosn't react at all. I was reviev following stackoverflow answer `
But when you will try to load fxml view it dosn't react why ? How I can make it work?. here is my code
@Override
public void start(Stage primaryStage) throws Exception
{
AnchorPane root = FXMLLoader.load(getClass().getClassLoader().getResource("order_state_modal.fxml"));
primaryStage.setTitle("Jasmin");
Scene scene = new Scene(root);
int ind = 1;
for(Screen screen : Screen.getScreens())
{
Rectangle2D bounds = screen.getVisualBounds();
if(ind == 2)
{
primaryStage.setX(bounds.getMinX());
primaryStage.setY(bounds.getMaxY());
}
ind ++;
}
primaryStage.setMaximized(true);
primaryStage.setScene(scene);
primaryStage.show();
}
`