Im using the Atlantfx for javafx layout. I’m using a Popover but if it was once visible, the application keeps running in the background after closing.
Minimal example code:
import atlantafx.base.theme.NordLight;
import atlantafx.base.controls.Popover;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Slider;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
public class Popup extends Application {
public void start(Stage stage)
{
Application.setUserAgentStylesheet(new NordLight().getUserAgentStylesheet());
Button button = new Button("show");
BorderPane pane = new BorderPane();
pane.setCenter(button);
Slider slider = new Slider();
slider.setMinWidth(80);
slider.setMinHeight(40);
Popover popover = new Popover(slider);
popover.setHeaderAlwaysVisible(false);
popover.setArrowLocation(Popover.ArrowLocation.LEFT_TOP);
button.setOnAction(actionEvent -> {
if (!popover.isShowing())
popover.show(button);
else
popover.hide();
});
Scene scene = new Scene(pane, 200, 200);
stage.setScene(scene);
stage.show();
}
public static void main(String args[])
{
launch(args);
}
}
If the Popover was once shown, there is an additional Thread started, that keeps running after closing the application. Am I’m doing something wrong, or is it a bug in Atlantafx?