-
Bug
-
Resolution: Cannot Reproduce
-
P2
-
8
-
linux 1.8b65
Run this code on linux b64 and b65
package javafxapplication16;
import com.sun.javafx.runtime.VersionInfo;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class JavaFXApplication16 extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(final Stage stage) throws Exception {
final Button b = new Button("Press me");
VBox vb = new VBox();
vb.getChildren().addAll(b);
final Scene scene = new Scene(vb, 300, 300);
b.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent t) {
System.out.println("X:" + stage.getX() + " Y:" + stage.getY());
System.out.println("X:" + scene.getX() + " Y:" + scene.getY());
}
});
stage.setTitle(VersionInfo.getRuntimeVersion());
stage.setScene(scene);
stage.show();
}
}
Output on b64:
X:808.0 Y:269.0
X:2.0 Y:23.0
Output on b65:
X:808.0 Y:269.0
X:0.0 Y:0.0
Look on the second line of output: scene coordinates on b65 don't take decoration into account.
package javafxapplication16;
import com.sun.javafx.runtime.VersionInfo;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class JavaFXApplication16 extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(final Stage stage) throws Exception {
final Button b = new Button("Press me");
VBox vb = new VBox();
vb.getChildren().addAll(b);
final Scene scene = new Scene(vb, 300, 300);
b.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent t) {
System.out.println("X:" + stage.getX() + " Y:" + stage.getY());
System.out.println("X:" + scene.getX() + " Y:" + scene.getY());
}
});
stage.setTitle(VersionInfo.getRuntimeVersion());
stage.setScene(scene);
stage.show();
}
}
Output on b64:
X:808.0 Y:269.0
X:2.0 Y:23.0
Output on b65:
X:808.0 Y:269.0
X:0.0 Y:0.0
Look on the second line of output: scene coordinates on b65 don't take decoration into account.
- relates to
-
JDK-8127833 [Linux] scene coordinates are defined incorrectly.
-
- Closed
-