Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Issue in JavaFX Runnable Thread


    bloodwi11

    Recommended Posts

    After some extensive testing as well as trial and error i was able to narrow down the cause to the Program.runLater();. That being said everything works fine and it creates the list as intended, But after the script is stopped the Panel no longer displays the list at all. here are 2 screens to show what is intended and what happens after the script is restarted. The only means I've found to even get it to display is restarting DreamBot entirely.

    public mGUI() {
            System.out.println("mGUI: mGUI()");
            taskWindow = new JFrame();
            taskWindow.addWindowListener(new WindowAdapter() {
                @Override
                public void windowClosing(WindowEvent e) {
                    Main.stopScript();
                }
            });
            final JFXPanel fxPanel = new JFXPanel();
            makePanel(taskWindow, fxPanel);
            Platform.runLater(() -> initFX(fxPanel));
            taskWindow.setVisible(true);
    }
    
    private void initFX(JFXPanel fxPanel) {
            System.out.println("mGUI: initFX()");
            managerList = new ListView<mObject>();
            managerList.setPrefSize(Config.MANAGER_WIDTH, Config.MANAGER_HEIGHT);
            managerList.setEditable(false);
            managerList.getItems().addAll(createList());
            managerList.setCellFactory(new mCellFactory());
    
            Pane root = new StackPane();
            root.getChildren().add(managerList);
            Scene scene = new Scene(root, Config.MANAGER_WIDTH, Config.MANAGER_HEIGHT);
            scene.getStylesheets().add(Config.MANAGER_STYLE);
            fxPanel.setScene(scene);
    }
    


    Working as intended/Broken
    5326d53020437ed361ae9c21a15ade43.png41cbfc4db4722ba1887111831154fd24.png

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.