Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Question EmbeddableUI - Inputstream is null

Joined
Nov 6, 2015
Messages
541
Hi,

I am trying to make a EmbeddableUI and it's working atleast the first one, but for some reason it can't load the second one and it's returning inputStream is null.

Yes, I have them in my script.manifest.xml as resources, I've tried to debug it multiple times and tried other ways, but it's weird that my first UI just loads but it can't find the second while it is in the same folder.

Working one (this one loads, and works with Controller):

Code:
@Override
    public ObjectProperty<Node> botInterfaceProperty() {
        if (botInterfaceProperty == null) {
            FXMLLoader loader = new FXMLLoader();
            loader.setController(new AIOQuesterUIStartController());
            try {
                Node node = loader.load(Resources.getAsStream("com/remco1337/bots/AIOQuester/ui/aioquester_start_ui.fxml"));
                botInterfaceProperty = new SimpleObjectProperty<>(node);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return botInterfaceProperty;
    }

Then form the AIOQuesterStartController if pressed on the start button I want it to load the next UI but that's not working (Yes the function is being called but here it returns inputStream is null while it supposed to be the same?):

Code:
public void loadStatusUI() {
        System.out.println("loadStatusUI: called!");
        FXMLLoader loader = new FXMLLoader();
        loader.setController(new AIOQuesterUIStatusController());
        try {
            System.out.println("loadStatusUI: called! test 1 | " + loader.load(Resources.getAsStream("com/remco1337/bots/AIOQuester/ui/aioquester_status_ui.fxml")));
            Node node = loader.load(Resources.getAsStream("com/remco1337/bots/AIOQuester/ui/aioquester_status_ui.fxml"));
            System.out.println("loadStatusUI: called! test 2");
            Platform.runLater(()-> botInterfaceProperty = new SimpleObjectProperty<>(node));
            System.out.println("loadStatusUI: Initalized!");
        }
        catch (Exception e) {
            System.out.println("Error | " + e);
            e.printStackTrace();
        }
    }
 
Top