MaDKit forum

Welcome All !
Please, use explicit topic names when creating new threads. Thanks.

You are not logged in.

#1 2014-02-23 21:42:26

jo
Member
Registered: 2014-02-23
Posts: 10

How to recuperate a variable value in an agent class

Hi,


Please, how can I recuperate the value of fd in  AgentLauncher class?

private void jToggleButton5ActionPerformed(java.awt.event.ActionEvent evt)

{                                               

String fd   =this.jTextField10.getText();

String[] argss = {"--agentLogLevel", "INFO", "--launchAgents",
                 AgentLauncher.class.getName()};

Madkit.main(argss);

}


public class AgentLauncher extends Agent {

protected void activate() {}
protected void live() {
       
    }

    @Override
    protected void end() {
       
       
    }

    /**
     * @param args
     */
        public static  void main(String[] args)
{}
}

Tanks.

Last edited by jo (2014-02-23 21:44:55)

Offline

#2 2014-02-24 14:13:17

fmichel
Administrator
From: Montpellier
Registered: 2009-03-24
Posts: 172
Website

Re: How to recuperate a variable value in an agent class

Hi

simply by doing this :

private void jToggleButton5ActionPerformed(java.awt.event.ActionEvent evt)

{                                               
String fd   =this.jTextField10.getText();

String[] argss = {"--fd", "aValue","--agentLogLevel", "INFO", "--launchAgents",
                 AgentLauncher.class.getName()};

Madkit.main(argss);
}

and

public class AgentLauncher extends Agent {

protected void activate() {
String value = getMadkitProperty("fd");
}

Offline

Board footer