JavaFX应用在Mac上在用户从全屏模式切换到另一个应用程序时崩溃。

huangapple 未分类评论45阅读模式
英文:

JavaFX application crashes on Mac when the user switch from it to another app in full screen mode

问题

我不明白它可能是什么。因此,我不知道从哪里着手。

我正在使用:

  • Java SE 1.8
  • 用于用户界面的 JavaFX

应用程序崩溃的情况:

  • 应用程序正在显示一个模态:
Stage dialog = new Stage();
dialog.setScene(new Scene(root));
dialog.initOwner(loader.getController());
dialog.initModality(Modality.WINDOW_MODAL); 
dialog.showAndWait();
  • 用户从此应用程序切换到全屏打开的另一个应用程序。

当错误发生时会出现以下情况:

  1. 应用程序关闭
  2. 控制台中出现错误(我很确定这不是 Java 异常)

JavaFX应用在Mac上在用户从全屏模式切换到另一个应用程序时崩溃。

问题是什么?
这只在 Mac 上发生吗?
如何解决这个问题?

英文:

I don't understand what it can be. For this reason I don't know where to get my hands.

I'm using:

  • Java SE 1.8
  • JavaFX for the user interface

The condition in which the application crashes:

  • The app is showing a modal:
Stage dialog = new Stage();
dialog.setScene(new Scene(root));
dialog.initOwner(loader.getController());
dialog.initModality(Modality.WINDOW_MODAL); 
dialog.showAndWait();
  • The user switches from this app to another app opened in full screen.

This is what happens when the error occurs:

  1. The application is closed
  2. An error appears in the console (I'm pretty sure it's not a java exception)

JavaFX应用在Mac上在用户从全屏模式切换到另一个应用程序时崩溃。

What is the problem?
Does it happen only on Mac?
How can I solve it?

答案1

得分: 0

我通过升级至JavaFX 14来解决了这个问题。
我猜这可能是库的一个bug。

英文:

I solved this problem by updating to JavaFX 14.
I suppose it was a bug of the library.

huangapple
  • 本文由 发表于 2020年4月6日 23:28:56
  • 转载请务必保留本文链接:https://java.coder-hub.com/61063287.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定