Is the external Java file inside a jar? If so, ideally you would do:
Runtime.exec("java-jarexternal-application.jar");
If the java file is inside your application, just import and use it
Considering you want to do a button click, I would suggest executing the code inside its own thread, otherwise your button is going to be non-responsive until the call returns.
Actually i am working on my college project. i have to call a external java file on the value from text field in javafx application. here is i am attaching the image of my project. drive.google.com/open
Jan Vladimir Mostert
Idea Incubator
Is the external Java file inside a jar? If so, ideally you would do:
Runtime.exec("java -jar external-application.jar");If the java file is inside your application, just import and use it Considering you want to do a button click, I would suggest executing the code inside its own thread, otherwise your button is going to be non-responsive until the call returns.