netbeans - Display two windows at the same time "on fullscreen" with JavaFx Scene Builder 2.0 -
i'm working on mini application need display users 2 windows @ same time on fullscreen (the application made users on dual screen).
i'm working javafx scene builder 2.0 on netbeans 8.0.1
i tried sec window gets displayed on fullscreen.
public void showtwoscreens() { seek { parent root = fxmlloader.load(getclass().getresource("clientsoperationswindow.fxml")); scene scene = new scene(root); globalstage.setscene(scene); globalstage.setfullscreen(true); globalstage.setresizable(true); globalstage.show(); stage anotherstage = new stage(); parent secondroot = fxmlloader.load(getclass().getresource("clientssearchwindow.fxml")); scene secondstage = new scene(secondroot); secondstage.setscene(anotherscene); secondstage.setfullscreen(true); secondstage.show(); } grab (exception ex) { system.out.println(ex.getmessage()); } } is possible display 2 windows on fullscreen ?
thank you!
i think can't set 2 stages in fullscreen in 2 monitors @ same time, can same result, forcing stage dimensions.
for that, we'll utilize javafx.stage.screen, characteristics each of different monitors connected. load fxml files each scene, , display each scene on stage. screen.getbounds() origin , dimensions of rectangle, refered primary screen. set each stage bounds bounds of these rectangles. set style undecorated. feature missing exit "fullscreen" mode key combination.
private screen secondaryscreen; @override public void start(stage primarystage) throws ioexception { screen primaryscreen = screen.getprimary(); parent root = fxmlloader.load(getclass().getresource("screen1.fxml")); scene scene = new scene(root); primarystage.setscene(scene); rectangle2d bounds = primaryscreen.getbounds(); primarystage.setx(bounds.getminx()); primarystage.sety(bounds.getminy()); primarystage.setwidth(bounds.getwidth()); primarystage.setheight(bounds.getheight()); primarystage.initstyle(stagestyle.undecorated); primarystage.show(); // sec screen screen.getscreens().stream() .filter(s->!s.equals(primaryscreen)) .findfirst().ifpresent(s->secondaryscreen = s); if(secondaryscreen!=null){ stage secondarystage = new stage(); parent root2 = fxmlloader.load(getclass().getresource("screen2.fxml")); scene scene2 = new scene(root2); secondarystage.setscene(scene2); rectangle2d bounds2 = secondaryscreen.getbounds(); secondarystage.setx(bounds2.getminx()); secondarystage.sety(bounds2.getminy()); secondarystage.setwidth(bounds2.getwidth()); secondarystage.setheight(bounds2.getheight()); secondarystage.initstyle(stagestyle.undecorated); secondarystage.show(); } } netbeans javafx javafx-2 scenebuilder
No comments:
Post a Comment