0

I have a javaFx program(A) into a jar which i am running on click of a button in the other JFrames program(B) using the command:

String rValue = A.main(arg);

A returns some value which is caught in rValue.
which the button is clicked for the first time it is working fine, but when this event occurs second time it is showing an error:

Error code

Exception in thread "main" java.lang.IllegalStateException: Application     launch must not be called more than once
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:162)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:143)
at javafx.application.Application.launch(Application.java:252)
at a.A.main(A.java:64)
at B.main(B.java:80)

I need some help for this. Thanks in advance.

fabian
  • 80,457
  • 12
  • 86
  • 114
Krishna E
  • 29
  • 6
  • Possible duplicate of [How to call launch() more than once in java](http://stackoverflow.com/questions/24320014/how-to-call-launch-more-than-once-in-java) – fabian Feb 26 '16 at 10:00
  • If i use run later then it will not return the value that i required. And i am confused with the usage of this method, in which class should i use it? – Krishna E Feb 26 '16 at 11:32

0 Answers0