JDK-8119782 : [Linux] stage situated not in setted coordinates
  • Type: Bug
  • Component: javafx
  • Sub-Component: scenegraph
  • Affected Version: fx2.1
  • Priority: P2
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2012-01-26
  • Updated: 2015-06-17
  • Resolved: 2012-01-31
Related Reports
Duplicate :  
Description
Run code:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

public class StageXY extends Application {

    @Override
    public void start(final Stage stage) throws Exception {
        Button b = new Button("fff");
        VBox vb = new VBox();
        
        Button b2 = new Button("ddd");
        VBox vb2 = new VBox();
        
        vb.getChildren().addAll(b);
        vb2.getChildren().addAll(b2);
        
        stage.setScene(new Scene(vb, 300, 300));
        
        Stage stage2 = new Stage();
        stage2.setScene(new Scene(vb2, 400, 400));
        stage2.show();
        
        stage.show();
        stage.setX(800);
        stage.setY(800);
        
        stage2.setX(800);
        stage2.setY(800);
    }

    public static void main(String[] args) {
        launch(args);
    }
}

Issue1 (RT-19232) the stage2 is not showed.
Issue2: stage situated not in setted coordinates. As I see, it is situated in default coordinates.
Comments
Properties regarding window position and size are already synchronized (RT-19320 was partially fixed for these properties, but cannot be closed as there are more properties that needs fixing). So this example should work already.
28-02-2012

This is a synchronization issue on X11 side, so marking it as a duplicate of RT-19320. show() calls immediately followed by setX, setY causes race conditions and may result in bad placement of windows. To fix this, simply do setX, setY before show().
31-01-2012