I need to make a action when the user make a new cell(drag and drop a cell from editorPallete).
graphComponent.addListener(mxEvent.ADD, new mxEventSource.mxIEventListener() {
@Override
public void invoke(Object sender, mxEventObject evt) {
System.out.println("event add");
}
} );
I do not receive any event for mxEvent.ADD, same result for mxEvent.ADD_CELLS.
You need to add the listener to the graph, not the graphComponent. You also need to use the CELLS_ADDED event instead of the ADD event. You can take a look at the api documentation for the mxGraph class to view a list of fired events for the class: http://jgraph.github.io/mxgraph/docs/js-api/files/view/mxGraph-js.html --> scroll down to the Events section
So your code should look something like this:
Hope this helps,