The error says that there’s a |NullPointerException| here
<https://github.com/NetLogo/NetLogo/blob/5.x/src/main/org/nlogo/app/App.scala#L163>.
The only way I can see that happening is if the arguments that you’re
passing into |App.main| are |null|. Check your |argv| value. If you
don’t want to pass arguments into |App.main|, pass in an empty array,
rather than |null|.
On 3/8/2015 7:40 PM, [email protected] wrote:
I want to connect netbeans to netlogo. I have a class: NetLogoConnection I want
to call the class when I click on OK btn in my GUI. The codes are as following:
import org.nlogo.app.App;
public class NetLogoConnection {
public static void main(String[] argv) {
App.main(argv);
try {
java.awt.EventQueue.invokeAndWait(
new Runnable() {
public void run() {
try {
App.app().open("C:/Users/fmar825/Desktop/fire.nlogo");
}
catch(java.io.IOException ex) {
ex.printStackTrace();
}}});
// App.app().command("set density 62");
// App.app().command("random-seed 0");
// App.app().command("setup");
//App.app().command("repeat 50 [ go ]");
//System.out.println(
//App.app().report("burned-trees"));
}
catch(Exception ex) {
ex.printStackTrace();
}
}
}
And the code for calling the class with JButton is as following :
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
NetLogoConnection.main(argv);
}
he error Message is a s following:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at org.nlogo.app.App$.moreTokens$1(App.scala:163)
at org.nlogo.app.App$.processCommandLineArguments(App.scala:164)
at org.nlogo.app.App$.main(App.scala:82)
at org.nlogo.app.App.main(App.scala)
at NetLogoConnection.main(NetLogoConnection.java:4)
at User.jButton1ActionPerformed(User.java:989)
at User.access$1600(User.java:31)
at User$19.actionPerformed(User.java:601)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2346)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6525)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6290)
--
You received this message because you are subscribed to the Google Groups
"netlogo-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.