简体   繁体   中英

Problem with Jar file loading in Scene Builder

I have a problem with adding my jar file to the Scene Builder Library. When I click open, nothing shows in the import dialog.

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

What I have found out so far is that when I comment "mb = new Alert(Alert.AlertType.CONFIRMATION);"the problem disappears and the jar loads.

How is the alert affecting all this?

警惕

毫无戒备

Javafx sdk 11, Java jdk 11, Scene Builder 11

Have you tried to add the alert before fmxlLoader.load() and see if that works

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM