Enqueue Callable confusion

Hi, I’m currently trying to make a JButton attach a Geometry to my scene.
I started the way the tutorial (https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:swing_canvas) explained it, but have the following problem:
The method attach() returns an integer, not a spatial.
So I changed
[java]new Callable<Spatial>()[/java]
to
[java]new Callable<Integer>()[/java]
and
[java]public Spatial call()[/java]
to
[java]public Integer call()[/java]

But that doesn’t work either.

Even though I’m playing around with JME for quiet a while now, I’m not very experienced in Java, so if I’m making a very stupid mistake here, please don’t lynch me :slight_smile:

Thank you, kibitzer

Forget it, it was a bug in the sdk (the netbeans editor).
I commented the code snipped. And then I removed the comment signs and everything was okay, it works now.
Editor being weird today.

EDIT: I don’t know how to mark this topic as solved, can’t find the button or sth., but it is.

The Generic in the Callable<Generic>
is used to return stuff from the callable.

This one explains what you could use this for. The generic if you do not want to return anything would be Void, wich only accepts return null as the returnvalue.

I suggest to read the following:
https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:multithreading

1 Like