-
Bug
-
Resolution: Fixed
-
P3
-
8
-
None
It is possible to create a Scene without specifying the width or height. If the scene has no intrinsic size (for example, if an empty group was specified as the content of the scene), then no window is shown. Instead, we should pick some size by default in such situations so that the window is at least shown. I would suggest a 320x200 default size. Any display in the last two decades will be able to show it, including most (all?) embedded screens we're targeting.
public class StartupApp extends Application {
@Override
public void start(Stage stage) throws Exception {
Scene scene = new Scene(new Group(), Color.FLORALWHITE);
stage.setScene(scene);
stage.show();
}
/**
* Java main for when running without JavaFX launcher
*/
public static void main(String[] args) {
launch(args);
}
}
public class StartupApp extends Application {
@Override
public void start(Stage stage) throws Exception {
Scene scene = new Scene(new Group(), Color.FLORALWHITE);
stage.setScene(scene);
stage.show();
}
/**
* Java main for when running without JavaFX launcher
*/
public static void main(String[] args) {
launch(args);
}
}
- duplicates
-
JDK-8119580 Gtk: some apps can't show window on linux
-
- Closed
-
- relates to
-
JDK-8088783 iOS, Andriod, Lens: Scene Width and Height, if not specified, result in no window being shown
-
- Open
-