Index: trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/commands/CMDgenerateJacaretoReplay.java
===================================================================
--- trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/commands/CMDgenerateJacaretoReplay.java	(revision 1883)
+++ trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/commands/CMDgenerateJacaretoReplay.java	(revision 1901)
@@ -343,12 +343,23 @@
         menuElements = new HashMap<>();
         modifiers = createModifierMap();
+
+        int index = 1;
+        for (List<Event> sequence : sequences) {
+            reinit();
+            writeJacaretoXML(sequence, filename + "_" + index, classpath, basepath, classpathext);
+            index++;
+        }
+    }
+
+    private void reinit() {
+        currentFocus = null;
         currentKeyModifiers = 0;
         StructureNode.nextRef = 0;
-
-        int index = 1;
-        for (List<Event> sequence : sequences) {
-            writeJacaretoXML(sequence, filename + "_" + index, classpath, basepath, classpathext);
-            index++;
-        }
+        lastFocusChangeEvent = null;
+        lastItemActionEvent = null;
+        lastKeySequenceEvent = null;
+        lastKeyTypedEvent = null;
+        lastMouseClickEvent = null;
+        lastMouseDownTarget = null;
     }
 
@@ -550,4 +561,6 @@
                     structure.children.add(lastMouseClickEvent);
                     structure.children.add(lastItemActionEvent);
+
+                    lastMouseClickEvent = null;
                 }
                 else {
@@ -736,4 +749,5 @@
 
         lastMouseDownTarget = null;
+        lastMouseClickEvent = null;
     }
 
@@ -813,6 +827,6 @@
         // get rid of the quote symbols in the command because we want to
         // escape the middle part for XML
-        String cmd = target.getName().substring(1, target.getName().length()-1);
-        
+        String cmd = target.getName().substring(1, target.getName().length() - 1);
+
         //@formatter:off
         writeLine(writer,
