1

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?

Xylotrope
  • 81
  • 5
  • Where is the rest of your code? – j will Sep 07 '15 at 04:00
  • Do you have a github of this? or a gist? – j will Sep 07 '15 at 04:42
  • I am working on a much larger project, which I am not at liberty to publicize. However, this script alone is sufficient to trigger the the issue I mentioned. – Xylotrope Sep 07 '15 at 13:44
  • Could you make a small working github project that replicates the problem? – j will Sep 07 '15 at 21:28
  • To replicate the problem, just run the script I gave in the Scala REPL. When the first window appears, drag it around the screen until the second one opens. I put it in a github repository here: https://github.com/jcoughlin9/ScalaFX_Window_Error_Demonstration/tree/master. However, that script is all you need to replicate the issue. – Xylotrope Sep 09 '15 at 02:30
  • I don't feel like having to put in the effort of running the repl and importing the scalafx jar, etc... – j will Sep 09 '15 at 21:00

0 Answers0