public boolean undoIt() { try { document.deleteCommand(position, strng.length()); } catch (Exception e) { return false; } // try return true; } // undoIt()