-
Bug
-
Resolution: Fixed
-
P4
-
fx2.0
-
None
Utils.getScreen() doesn't handle the case when scene is not added to any Window. The test below throws the following exception:
java.lang.NullPointerException
at com.sun.javafx.Utils.getOffsetX(Utils.java:645)
at com.sun.javafx.Utils.getScreen(Utils.java:778)
at Test.start(Test.java:22)
caused by the following code in Utils.getOffsetX():
return scene.getX() + scene.getWindow().getX();
The test is
import com.sun.javafx.Utils;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
public class Test extends Application {
public static void main(String[] args) {
Application.launch(Test.class, args);
}
@Override public void start(Stage stage) {
Rectangle r = new Rectangle();
Scene sc = new Scene(new Group(r));
System.out.println(Utils.getScreen(r));
}
}
java.lang.NullPointerException
at com.sun.javafx.Utils.getOffsetX(Utils.java:645)
at com.sun.javafx.Utils.getScreen(Utils.java:778)
at Test.start(Test.java:22)
caused by the following code in Utils.getOffsetX():
return scene.getX() + scene.getWindow().getX();
The test is
import com.sun.javafx.Utils;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
public class Test extends Application {
public static void main(String[] args) {
Application.launch(Test.class, args);
}
@Override public void start(Stage stage) {
Rectangle r = new Rectangle();
Scene sc = new Scene(new Group(r));
System.out.println(Utils.getScreen(r));
}
}
- blocks
-
JDK-8113869 Remove workaround for RT-14659 from ScreenAndWindowTest
-
- Resolved
-
- relates to
-
JDK-8113753 crash upon opening webview
-
- Resolved
-