0

I'm working on some app with GUI using javafx and have one trouble. Notifications from controlsfx library (org.controlsfx.control.Notifications) work well when I'm running Main class from ItelliJ IDEA, but don't work in compiled jar (I have compiled jar using 'Build artifacts'). Other functionality work as well. Here is method from Controll class that should open pop-up window

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();
}

Can somebody help me with using this notifications when I'm running jar? Thanks!

  • Just a guess but have you tried adding the `ControlsFX` jar as to the same folder as the jar you are trying to run? Or try putting it in a resource folder in the same folder as the jar you are trying to run. – SedJ601 Feb 17 '18 at 19:06
  • Yes, I have tried to put ControlsFX jar in every place that it can be. I use at least 5 external jar-files with libraries and all of them work well. I have problem only with ControlsFX. All external libs are in one folder, so I don't understand what is wrong with ControlsFX... – Yurii Mytiai Feb 17 '18 at 20:26

1 Answers1

0

I have fixed this isue by printing info to console. The problem was that there weren't two needed folders in final jar archive (I think it's IDEA bug) so I putted in them manually. After that I had javafx exception and I added this code

    notif1.owner(chart3);

before

    notif1.showWarning();

to avoid it.