Hello guys,
I am trying to implement JavaFX in my J-link app. A JavaFX app is run by calling main method of the JFXapp class. When I call main method in start method of J-link app, the java.lang.ClassNotFoundExeption is caught.
Can I somehow solve this problem to implement JavaFX components in my J-link app?
PS: my source code:
--------- J-link app class ----------
import com.ptc.cipjava.jxthrowable;
import com.ptc.pfc.pfcGlobal.pfcGlobal;
import com.ptc.pfc.pfcSession.Session;
public class TestApp {
public static void start() throws jxthrowable {
Session curSession = pfcGlobal.GetProESession();
curSession.UIShowMessageDialog("App started !", null);
String[] args = {};
JFX.main(args);
}
public static void stop() {
System.out.println("Stopped");
}
}
--------- JavaFX app class ----------
import com.ptc.cipjava.jxthrowable;
import com.ptc.pfc.pfcGlobal.pfcGlobal;
import com.ptc.pfc.pfcSession.Session;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class JFX extends Application {
public static void main(String[] args) throws jxthrowable {
Session curSession = pfcGlobal.GetProESession();
curSession.UIShowMessageDialog("Class of JavaFX app found!", null);
try {
launch(args);
} catch (Exception e) {
curSession.UIShowMessageDialog(e.getMessage(), null);
}
}
@Override
public void start(Stage primaryStage) throws Exception {
init(primaryStage);
primaryStage.show();
}
private void init(Stage primaryStage){
Group root = new Group();
Scene scene = new Scene(root);
primaryStage.setTitle("JavaFX-J-link app");
primaryStage.setScene(scene);
}
}