i can not linked javaFx with agent class , i want to pass the instance value of javafx application to agent class for interacting with GUI of javaFx and the Inverse From agent class i want to pass the instance object of current agent to JavaFx application to do some stuff
public class ClientAgent extends Agent {
@Override
protected void setup() {
}}
public class ClientController extends Application {
private ClientAgent clientAgent;
@Override
public void start(Stage primaryStage) throws Exception{
Group flowPane=new Group();
JFXButton jfxButton=new JFXButton("Login");
flowPane.getChildren().add(jfxButton);
primaryStage.setTitle("Hello World");
primaryStage.setScene(new Scene(flowPane, 600, 400));
primaryStage.show();
jfxButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
}
});
}
public void setClientAgent(ClientAgent clientAgent) {
this.clientAgent = clientAgent;
}
}
public class ClientContainer {
public static void main(String [] args) {
try {
Runtime runtime=Runtime.instance();
ProfileImpl profile=new ProfileImpl(false);
profile.setParameter(Profile.MAIN_HOST,"localhost");
AgentContainer agentContainer=runtime.createAgentContainer(profile);
AgentController agentController=agentContainer.createNewAgent("client", ClientAgent.class.getName(),new Object[] {});
agentController.start();
} catch (StaleProxyException e) {
e.printStackTrace();
} catch (ControllerException e) {
e.printStackTrace();
}
}
}