How to distinguish 揈SC?from clicking on another JTree node

I have implemented the editingCanceled/editingStopped interface for my DefaultTreeCellEditor of the JTree. I have notices that it is called when I press 揈SC?key or I click on another node of my JTree.

How can I distinguish between those two ?in other words I want to know whether my editingCanceled is called from 揈SC?or just by clicking on another node.

Can I figure it out inside of the editingCanceled method?

[431 byte] By [rejki@optusa] at [2007-11-27 3:25:37]
# 1

use a Key Listener to know when the ESC Key was clicked.

component.addKeyListener(new MyKeyListener());

public class MyKeyListener extends KeyAdapter {

public void keyPressed(KeyEvent evt) {

// Check for key codes.

if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) {

process(evt.getKeyCode());

}

}

}

Hope That Helps

java_2006a at 2007-7-12 8:28:24 > top of Java-index,Desktop,Core GUI APIs...