How to remove an object in the patcher from JAVA ?

Julien Bayle's icon

Calling/placing my set of abstraction from JAVA in the patcher, I'd need also to remove them.

Does it exist a "remove" method as in JS ?

Julien Bayle's icon

sorry
answering to myself for reference purpose:

/Applications/Max6/java-doc/api/com/cycling74/max/MaxBox.html#remove()

remove() exists basically & obviously :)

audiovisualist's icon

Hey Julien,
can you give me a short workaround about the delete method? I read the api ad tried out several versions in java but it doesn't work. In js it was really easy but in java i didn't get it working. that is my simple code, i am working on.
thanks

import com.cycling74.max.*;

class Verschaltung extends MaxObject{
MaxPatcher p = getParentPatcher();

    public Verschaltung()
{

}

public void create(int x,int y){
    MaxBox b11 = p.newDefault(20,20,"toggle",null);
MaxBox b21 = p.newDefault(50,20,"toggle",null);
MaxBox b31 = p.newDefault(80,20,"toggle",null);
MaxBox b41 = p.newDefault(x, 80, "flonum", null);
MaxBox b51 = p.newDefault(20, y, "number", null);
MaxBox b61 = p.newDefault(20, 400, "pak", null);
}
public void deleteAll(){
    MaxPatcher.remove(b11);
}

}

audiovisualist's icon

OK, i figured it out, how to remove an object. But now i have my number box and want to initiate it with an value. I created an Atom[] of the length 1 and filled it with "1". But the value doesn't change in the maxpat.