【发布时间】:2018-02-17 16:13:36
【问题描述】:
我正在使用 javafx 开发一些带有 GUI 的应用程序,但遇到了一个问题。 当我从 ItelliJ IDEA 运行 Main 类时,来自 controlsfx 库 (org.controlsfx.control.Notifications) 的通知运行良好,但在编译的 jar 中不起作用(我使用“构建工件”编译了 jar)。其他功能也可以。 这是 Controll 类中应该打开弹出窗口的方法
public void zAxisMouseEntered(MouseEvent mouseEvent) {
Notifications notif1 = Notifications.create();
notif1.title("Warning message");
notif1.text("This configuration is slower than 'SPL on Z axis'");
notif1.hideAfter(Duration.seconds(3));
notif1.position(Pos.CENTER);
notif1.showWarning();
}
有人可以在我运行 jar 时帮助我使用此通知吗? 谢谢!
【问题讨论】:
-
只是一个猜测,但您是否尝试将
ControlsFXjar 添加到与您尝试运行的 jar 相同的文件夹中?或者尝试将它放在与您尝试运行的 jar 相同的文件夹中的资源文件夹中。 -
是的,我已经尝试将 ControlsFX jar 放在它可以放置的每个地方。我使用至少 5 个带有库的外部 jar 文件,它们都运行良好。我只有 ControlsFX 有问题。所有外部库都在一个文件夹中,所以我不明白 ControlsFX 有什么问题...
标签: java javafx popup controlsfx