Swing uses key bindings to map actions to components. To find out the default mappings for this component, you can use Key Bindings . The article also contains a link to the Swing tutorial, which contains the section "How to Use Key Bindings".
To create your own action, you must extend the TextAction so that you have access to the text component. Then you will need to get the current carriage position. You can then use the Utilities class to start or end the current word, and then you can remove characters from the document.
source share