set stage owner

This commit is contained in:
Jan-Peter Klein 2024-09-11 15:06:27 +02:00
parent 00e1e3654e
commit f9bfd5d1b1
No known key found for this signature in database
GPG Key ID: 90EDA3A7C822FD0E
2 changed files with 4 additions and 2 deletions

View File

@ -82,7 +82,8 @@ public class SupporterCertificateController implements FxController {
@FXML
void didClickRemoveCert() {
removeCert.build().showRemoveCert();
Stage pref = (Stage) supporterCertificateField.getScene().getWindow();
removeCert.build().showRemoveCert(pref);
}
public LicenseHolder getLicenseHolder() {

View File

@ -18,10 +18,11 @@ public interface RemoveCertComponent {
@FxmlScene(FxmlFile.REMOVE_CERT)
Lazy<Scene> scene();
default void showRemoveCert() {
default void showRemoveCert(Stage owner) {
Stage stage = window();
stage.setScene(scene().get());
stage.sizeToScene();
stage.initOwner(owner);
stage.show();
}