我想用 javafx 在 scala 中创建一个弹出窗口
final val popup = new Popup
val text: Text = new Text(s)
popup.setAutoFix(false)
popup.setHideOnEscape(true)
popup.getContent().addAll(text)
popup.setX(250)
popup.setY(175)
popup.show(stage)
但我有一个错误
org.view.View@72d873: caught java.lang.IllegalStateException: Not on FX application thread; currentThread = ForkJoinPool-1-worker-1
java.lang.IllegalStateException: Not on FX application thread; currentThread = ForkJoinPool-1-worker-1
有人有想法吗?
感谢