textComponent.cut();
} else if (e.getSource() == copyItem) {
if (!haveSelection) textComponent.selectAll();
textComponent.copy();
} else if (e.getSource() == pasteItem) {
textComponent.paste();
} else if (e.getSource() == deleteItem) {
if (!haveSelection) textComponent.selectAll();
textComponent.replaceSelection("");
} else if (e.getSource() == selectAllItem) {
textComponent.selectAll();