Scene Builder中加载Jar文件的问题

问题描述 投票:0回答:1

我将我的jar文件添加到Scene Builder库时遇到问题。当我单击“打开”时,导入对话框中没有任何显示。

private Alert mb;
public FXMLDocumentController() {
        FXMLLoader fxmlLoader = new FXMLLoader(
        getClass().getResource("/data/Data.fxml"));

        fxmlLoader.setRoot(this);
        fxmlLoader.setController(this);

        try {
            fxmlLoader.load();
        } catch (IOException exception) {
            throw new RuntimeException(exception);
        }
        mb = new Alert(Alert.AlertType.CONFIRMATION);
    }

到目前为止,我发现,当我评论“ mb = new Alert(Alert.AlertType.CONFIRMATION);”时,问题消失,广口瓶装满。

警报如何影响所有这些?

java javafx scenebuilder
1个回答
0
投票

您必须将随机的人放到场景构建器中

© www.soinside.com 2019 - 2024. All rights reserved.