Index: /main/trunk/gli/src/org/greenstone/gatherer/Gatherer.java
===================================================================
--- /main/trunk/gli/src/org/greenstone/gatherer/Gatherer.java	(revision 32685)
+++ /main/trunk/gli/src/org/greenstone/gatherer/Gatherer.java	(revision 32686)
@@ -755,5 +755,10 @@
 		}
 	}*/
-
+		g_man.setName("GUIManager"); // g_man has a name "frame0" assigned automatically
+		// setNamesRecursively won't assign a name if one is already set
+		// Setting explicitly since GUIManager is preferred for its name
+		GUIManager.setNamesRecursively("", g_man);
+		GUIManager.printComponentNames(g_man, "");
+		
 		// If there was a collection left open last time, reopen it	
 		if (open_collection_file_path == null || new File(Gatherer.open_collection_file_path).isDirectory()) {
Index: /main/trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java
===================================================================
--- /main/trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java	(revision 32685)
+++ /main/trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java	(revision 32686)
@@ -42,4 +42,5 @@
 import java.io.File;
 import java.lang.*;
+import java.lang.reflect.*;
 import java.net.*;
 import java.util.*;
@@ -67,4 +68,5 @@
 import org.greenstone.gatherer.util.Utility;
 
+     
 /** The GUIManager is in charge of creating the Gatherer window frame then filling it with the goodness of the view panes. GUIManager not only creates these panes, but allows some messaging between them. Furthermore GUIManager includes functionality from menu driven choices, simply as it was easier to put it here once and have it accessible from all pane children. */
 public class GUIManager
@@ -142,4 +144,111 @@
     }
 
+    /*
+      For GUI swing testing of GLI, it's very handy for components to have names
+      I use the GLI classname as name or if it's not a GLI class, then:
+       - if a member var of a GLI class, then GLIclassName.memberVarName
+       - else GLIClassName.swingComponentName
+      Google: "Java swing automatically setName"
+      -> https://stackoverflow.com/questions/3628218/strategy-for-naming-swing-components
+         https://stackoverflow.com/questions/1782598/with-java-reflection-how-to-instantiate-a-new-object-then-call-a-method-on-it
+      - https://stackoverflow.com/questions/4163500/how-to-automatic-set-name-attr-of-gui-components/4164479#4164479
+      - https://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.wb.swing.doc.user%2Fhtml%2Fwizards%2Fswing%2Fautomatic_databinding.html
+      - https://stackoverflow.com/questions/28639294/in-java-how-to-get-name-of-component-which-is-clicked
+    */
+    public static void setNamesRecursively(String prefix, Component root) {
+	
+	// root starts off as GLI's JFrame, so we know that all its GUI children are specifically JComponents
+	
+	// https://docs.oracle.com/javase/7/docs/api/index.html?java/lang/reflect/package-summary.html
+	String className = root.getClass().getSimpleName();
+	
+	String packageName = root.getClass().getPackage().getName();
+	if(!packageName.contains("org.greenstone.gatherer.gui")) {
+	    if(root.getName() == null || root.getName().equals("")) { // if name not already set
+		if(!prefix.equals("")){
+		    // TODO: fix this
+		    root.setName(prefix + "." + className);
+		}
+		else {
+		    root.setName(className);
+		}
+	    } // else swing Component name already set
+	    
+	} else { // root is in GLI GUI package, use its classname for name
+	    
+	    if(root.getName() == null || root.getName().equals("")) {
+		root.setName(className);
+	    }
+	    prefix = className;
+	    
+	    // check member vars
+	    Field[] memberVars = root.getClass().getDeclaredFields(); // private to public member vars, but not inherited ones	    
+	    for(int i = 0; i < memberVars.length; i++) {
+		memberVars[i].setAccessible(true); // make private/protected etc fields accessible
+		
+		// https://www.tutorialspoint.com/java/lang/class_isinstance.htm
+		Class jCompClass = Container.class;
+		Class memberVarClass = memberVars[i].getType();
+
+		// memberVarClass is a JComponen (subclass)
+		if(jCompClass.isAssignableFrom(memberVarClass)) {
+		    
+		    // get the actual member variable denoted by memberVars[i]
+		    // on the current JComponent instance 'root'.
+		    // We now know this member var to be a JComponent
+		    // Having the actual member variable of the instantiated instance,
+		    // we can call setName on it
+		    try {
+			Container memberComponent = (Container)memberVars[i].get(root);
+		    
+			if(memberComponent != null) {
+
+			    // member var is a JComponent but not of GLI package, so locally instantiated
+			    if(!memberVarClass.getPackage().getName().contains("org.greenstone.gatherer.gui")) {
+				String memberprefix = prefix + "." + memberVars[i].getName(); // append member var name
+				// now can call setName() on the actual member variable
+				memberComponent.setName(memberprefix);
+				setNamesRecursively(memberprefix, memberComponent);
+			    }
+
+			    //else  the member variable is a GLI GUI class, use its className as prefix for child components
+			    // Skip this step to avoid circular references to our own member vars
+			    /*else { // member variable is a GLI GUI class, use its className as prefix for child components
+				String memberprefix = memberVarClass.getSimpleName();
+				memberComponent.setName(memberprefix);
+				setNamesRecursively(memberprefix, memberComponent);
+			    }*/
+			
+			    
+			}
+		    } catch(Exception e) {
+			e.printStackTrace();
+		    }
+		}
+		// else not a JComponent, skip
+	    }	    
+	}
+
+	
+	// https://stackoverflow.com/questions/33927349/could-someone-please-explain-note-this-method-should-be-called-under-awt-tree
+	// No worries about AWT tree lock: setNamesRecursively is called by openGUI
+	// which is specifically called by GathererProg on the Event Dispatch Thread (EDT)
+	Component[] children = ((Container)root).getComponents();
+	for(int i = 0; i < children.length; i++) {
+	    // if we haven't already set a name for any child JComponents with the above,
+	    // then the following will do so now
+	    setNamesRecursively(className, children[i]);
+	}
+	
+    }
+
+    public static void printComponentNames(Component root, String tabbing) {
+	System.err.println(tabbing + root.getName());
+	Component[] children = ((Container)root).getComponents();
+	// recursive call
+	for(int i = 0; i < children.length; i++) {
+	    printComponentNames(children[i], tabbing + "  ");
+	}
+    }
 
     public void windowGainedFocus(WindowEvent e)
