JavaFX 8: empty scene after exiting standby

I had a strange problem with JavaFX (jdk8, build 117): after restarting the monitor in standby mode, the JavaFX scene / scene is empty.

I tried to minimize / resize the window, but the content is no longer displayed. I am using a simple scene using StackPane.

root = new StackPane(); root.setBackground(null); scene = new Scene(root, Color.BLACK); stage.setScene(scene); ProgressIndicator piLoader = new ProgressIndicator(); piLoader.setMaxSize(32d, 32d); root.getChildren().add(piLoader); stage.show(); 

I tried to find a known bug or previous report, but could not find.

+6
source share
1 answer

JDK8 is still very popular and marked as an early release, so you should expect such problems. I just tested it on a JDK8 built by b121 (Win8 64bit and Ubuntu 13.10 64 bit) and it seems like this is normal.

Upgrade your JDK version to the latest version and see if this solves your problem.

UPDATE: here is the complete standard standard that works without problems for me, the monitor goes into sleep mode and returns without any display problems. Hibernation is the only option Windows 8 gives me, so itโ€™s not โ€œStandby,โ€ as you say. What OS are you using?

 package helloworld; import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.ProgressIndicator; import javafx.scene.layout.StackPane; import javafx.scene.paint.Color; import javafx.stage.Stage; public class HelloWorld extends Application { @Override public void start(Stage primaryStage) { Button btn = new Button(); btn.setText("Say 'Hello World'"); btn.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { System.out.println("Hello World!"); } }); StackPane root = new StackPane(); root.setBackground(null); root.getChildren().add(btn); ProgressIndicator piLoader = new ProgressIndicator(); piLoader.setMaxSize(32d, 32d); root.getChildren().add(piLoader); Scene scene = new Scene(root, 300, 250, Color.BLACK); primaryStage.setTitle("Hello World!"); primaryStage.setScene(scene); primaryStage.show(); } /** * @param args the command line arguments */ public static void main(String[] args) { launch(args); } } 
+2
source

All Articles