A editable JGoText,how to catch Delete key?

I create a Node whic include a editable JGoText and other elements.

In the JGoView,I catch the “Delete” key to delete JGoView selection.But when i am edit the JGoText,I select some text chars,then press “Delete”,I only want to delete the JGoText chars,but not delete the Node.



How to implement this?

Tks.

You don’t need to catch the “Delete” key to accomplish this. This is the default behavior of JGoText. Just make sure that the JGoText object is editable. If you then click on the text and select any or all of the text, the delete key wil delete the selected text, not the node.

You verify this by executing the following code:
JGoBasicNode n = new JGoBasicNode("test");
n.setLocation(100, 100);
n.getLabel().setEditable(true);
this.jGoView1.getDocument().add(n);