JavaFx Stage :: setY first call incompatible with Linux - workaround?

When I run the following program, there is a 50% chance that the first click on the button will cause the window to be moved 10 pixels lower (using Ubuntu linux, Oracle JDK 1.8, JavaFx 8.0.102-b14). After that, each click correctly leads to a slight shift up.

import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.layout.StackPane; import javafx.stage.Stage; public class JavaFxTest extends Application { @Override public void start(Stage myStage) { myStage.setTitle("Hello World!"); Button myButton = new Button(); myButton.setText("Click!"); myButton.setOnAction(event -> myStage.setY(myStage.getY() - 1)); StackPane myStackPane = new StackPane(); myStackPane.getChildren().add(myButton); myStage.setScene(new Scene(myStackPane, 300, 250)); myStage.show(); } public static void main(String[] args) { launch(args); } } 

The error is shown in the following video: https://youtu.be/c7QFuya7V4M

With awt and swing, I ran into similar problems and posted a question here: Workaround for bug_id = 4806603 regarding getBounds () and setBounds () on Linux?

Does anyone have a workaround to properly position the window?

+1
java linux javafx-8
source share

No one has answered this question yet.

See similar questions:

7
Workaround for bug_id = 4806603 regarding getBounds () and setBounds () on Linux?

or similar:

24
JavaFX: stage completion handler
7
Workaround for bug_id = 4806603 regarding getBounds () and setBounds () on Linux?
4
JavaFX - the center of the child phase to the parent stage
3
JPanel added but not showing "in time"
2
ActionListeners and Core Methods
one
skin.json libgdx error file
one
JTree select a node by clicking anywhere in the row
0
javafx: graphical crash when switching scenes - fixed scene decorations
0
Javafx Stage is empty for a moment
0
Focus Traversable on CustomMenuItem. Concentration of free space on the mouse

All Articles