i have simple application in javafx: full screen stage 1 exit button. problem time time (no idea why not always) after clicking on "exit" button application blinks (seems minimized , maximized in miliseconds). ideas?
import javafx.application.application; import javafx.application.platform; import javafx.scene.scene; import javafx.scene.control.alert; import javafx.scene.control.button; import javafx.scene.control.buttontype; import javafx.scene.input.keycombination; import javafx.scene.layout.vbox; import javafx.stage.modality; import javafx.stage.stage; import javafx.stage.stagestyle; import java.util.optional; public class fullscreenexample extends application { public static void main(string[] args) { launch(args); } @override public void start(stage stage) { button button = new button("exit"); button.setonaction(event -> { alert alert = new alert(alert.alerttype.confirmation); alert.initowner(stage); alert.initstyle(stagestyle.undecorated); alert.initmodality(modality.window_modal); optional<buttontype> result = alert.showandwait(); if (result.get() == buttontype.ok){ platform.exit(); } }); vbox box = new vbox(); box.getchildren().add(button); final scene scene = new scene(box); scene.setfill(null); stage.setscene(scene); stage.setfullscreenexithint(""); stage.setfullscreenexitkeycombination(keycombination.no_match); stage.setfullscreen(true); stage.show(); } }
you using stage style undecorated:
alert.initstyle(stagestyle.undecorated);
try use
alert.initstyle(stagestyle.transparent);
this fixes blinking.
its known issue undecorated frame in windows.
Comments
Post a Comment