The list of methods to do JTextComponent Action are organized into topic(s).
T
getAction(JTextComponent target, Class aClass) Searches all actions of a JTextComponent for ab action of the given class and returns the first one that matches that class, or null if no Action is found
for (Object k : target.getActionMap().allKeys()) {
Action a = target.getActionMap().get(k);
if (aClass.isInstance(a)) {
@SuppressWarnings("unchecked")
T t = (T) a;
return t;
return null;
void
setHistoryActions(JTextComponent textComponent) set History Actions
Document doc = textComponent.getDocument();
UndoManager undo = new UndoManager();
doc.addUndoableEditListener(new UndoableEditListener() {
@Override
public void undoableEditHappened(UndoableEditEvent evt) {
undo.addEdit(evt.getEdit());
});
...