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

    Recommended Posts

    Posted (edited)

    I'm trying to write a script which launches a JavaFX application (instead of Swing - for many reasons). I've coded the JavaFX app (not looking for basic syntax help here...), and it launches standalone perfectly fine. I'm trying to launch it at the beginning of my script so I'm using the below in order to launch it, but nothing is being launched:

    new Thread(() -> Application.launch(SettingsPanelFX.class)).start();

    Before you ask I'm launching it on a separate thread so that the GUI is able to be used while the bot is still being run (to adjust parameters on the fly, partly for debugging purposes but also so that the user never needs to re-launch the script and adjust specific settings such as potion quantities).

    Anyway, just trying to "get it running" I've called the below in order to get the GUI to launch but it still doesn't work

    Application.launch(SettingsPanelFX.class);

    I'm not entirely sure what the issue could be. 

    image.png.ac6fe1b12dcec99994674c5f247d0ce8.png

    I suspect that this might have something to do with the way that DreamBot scripts get built?

     

    Edited by badramen
    Posted

    I had this same issue prior to launching my first script. I would launch one instance fine, though the thread would not terminate properly on script end causing issues when starting back up.

    Call me crazy, but what’s wrong with swing? There’s lots of nice libraries to make it look good, and good implementations within IntelliJ and other IDEs

    Posted
    14 hours ago, badramen said:

    I'm trying to write a script which launches a JavaFX application (instead of Swing - for many reasons). I've coded the JavaFX app (not looking for basic syntax help here...), and it launches standalone perfectly fine. I'm trying to launch it at the beginning of my script so I'm using the below in order to launch it, but nothing is being launched:

    new Thread(() -> Application.launch(SettingsPanelFX.class)).start();

    Before you ask I'm launching it on a separate thread so that the GUI is able to be used while the bot is still being run (to adjust parameters on the fly, partly for debugging purposes but also so that the user never needs to re-launch the script and adjust specific settings such as potion quantities).

    Anyway, just trying to "get it running" I've called the below in order to get the GUI to launch but it still doesn't work

    Application.launch(SettingsPanelFX.class);

    I'm not entirely sure what the issue could be. 

    image.png.ac6fe1b12dcec99994674c5f247d0ce8.png

    I suspect that this might have something to do with the way that DreamBot scripts get built?

     

    It can't load your javaFX class, I don't have an answer exactly how to fix it but I ran into the same problem trying to load an external library into a different API and got the same error.

    Posted

    It looks like the JVM you're using doesn't include JavaFX (which is why we don't allow JavaFX on the SDN). JavaFX isn't usually included in most Java installations anymore.

    • 2 weeks later...
    Posted

    Can't we just include JavaFX library as a dependency and package it into the jar

    • 7 months later...
    Posted (edited)

    I know this post is a bit old, but I thought I'd add some information here regarding this for anyone who is curious...
     

    Q: Why do other libraries work at runtime except for JavaFX?

    Spoiler

    JavaFX is different from most libraries, which are not as tightly integrated with the Java module system. Why? Because JavaFX was designed to strictly use Java's module system (JPMS) for security and performance reasons.

    When you compile JavaFX into your JAR file through an IDE like Intellij or maven, it gets placed on the classpath, breaking the module encapsulation required by JavaFX. Basically, it just can’t find its own files anymore.


    Q: Ok, so then what is the "proper" way to build a JavaFX-supported program?

    Spoiler

    The CORRECT way to build JavaFX applications is by using tools like jlink, jpackage, or native-image. However, these build options won't work for us.

    • jlink: this produces a directory that can be executed directly via command-line scripts. No JAR file output. 
    • jpackage: It generates .exe, .pkg, or .deb installer files. No JAR file output. 
    • native-image: A native binary (like .exe). No JAR file output. 


    Q: Are there any workarounds?

    Spoiler

    There is a workaround mentioned in this stackoverflow thread, but it's generally discouraged due to issues like large file size and limited cross-platform compatibility: https://stackoverflow.com/questions/52653836/maven-shade-javafx-runtime-components-are-missing

    Another option might be to download the libraries at runtime and load them dynamically, but this requires a custom class loader and may still be unreliable.

    Either way, as Pandemic noted, JavaFX is not allowed as a dependency for scripts on the SDN.

     

    TL;DR:
    JavaFX requires the module path for encapsulation, so shaded JARs on the classpath cause runtime issues—regardless its not allowed on the SDN.

    Edited by jesssterrr
    • 1 month later...
    Posted

    The discussion on using JavaFX application in DreamBot script highlights the importance of integrating different technologies to create more efficient and user-friendly applications. Similarly, in healthcare, the concept of advocacy campaigns plays a crucial role in improving patient outcomes and promoting necessary changes in policy and practice. Just as the DreamBot community shares knowledge to optimize scripts, resources like https://www.nursingpaper.com/examples/advocacy-campaign-developing-essay/ provide guidance on developing effective advocacy campaigns in nursing. Both fields—technology and healthcare—require innovative approaches to problem-solving, collaboration, and strategic planning to achieve positive results and create lasting impact.

    • 3 months later...
    Posted

    EssayShark is an exceptional platform for students seeking high-quality academic assistance. The writers demonstrate a high level of professionalism and expertise. One of the best aspects is the ability to choose a writer based on ratings and reviews. Students who need urgent help will find it a great solution due to its fast turnaround time. Another advantage is its transparent pricing, allowing users to see costs upfront. The customer support team is always ready to assist with any inquiries. Many users have shared positive experiences, praising the quality and originality of the work. It’s a reliable service that helps students achieve their academic goals. Anyone looking for expert assistance should definitely give it a try.

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    ×
    ×
    • 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.