I am working on a ScalaFX application using multiple windows. However, if I drag one ScalaFX window around while another window is in the process of opening, the entire desktop becomes unresponsive. When this occurs, most applications do not respond at all to mouse events, and it is not possible to close either ScalaFX window. The only way I have found to restore responsiveness is to terminate the Java process through the task manager, which itself can only be opened after issuing a ctrl-alt-del.
Here is a simple script that can trigger the issue. It loads one window, waits 3 seconds, and then opens a second window. However, if the first window is being dragged at the same time that the second window opens, it triggers the issue.
import javafx.embed.swing.JFXPanel
import scalafx.application.Platform
import scalafx.scene.Scene
import scalafx.scene.control.Label
import scalafx.stage.Stage
new JFXPanel
Platform.runLater {
val stage = new Stage {
title = "Stage 1"
width = 300
height = 200
scene = new Scene {
root = new Label("Stage 1")
}
}
stage.showAndWait()
}
Thread sleep 3000
Platform.runLater {
val stage = new Stage {
title = "Stage 2"
width = 300
height = 200
scene = new Scene {
root = new Label("Stage 2")
}
}
stage.showAndWait()
}
I am using Java 8 update 60 and Scalafx 8.0.40-R8 on a Windows 10 machine.
Any ideas as to why this is happening or how to fix it?