Index: /trunk/gli/src/org/greenstone/gatherer/gui/MetaEditPane.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/gui/MetaEditPane.java	(revision 6215)
+++ /trunk/gli/src/org/greenstone/gatherer/gui/MetaEditPane.java	(revision 6216)
@@ -66,4 +66,5 @@
 import org.greenstone.gatherer.util.PatternTokenizer;
 import org.greenstone.gatherer.util.StaticStrings;
+import org.greenstone.gatherer.util.TableUtils;
 import org.greenstone.gatherer.util.TreeSynchronizer;
 import org.greenstone.gatherer.util.Utility;
@@ -77,4 +78,22 @@
     extends JPanel
     implements ActionListener, ListSelectionListener, TreeSelectionListener, MSMListener {
+
+    static private Dimension BUTTON_SIZE = new Dimension(190, 25);
+    static private Dimension CONTROL_SIZE = new Dimension(560, 240);
+    static private Dimension MINIMUM_SIZE = new Dimension(100, 100);
+    static private Dimension TABLE_SIZE = new Dimension(560, 25);
+    static private Dimension TREE_SIZE = new Dimension(250, 500);
+    static private int MINIMUM_TABLE_HEADER_SIZE = 15;
+    /** The name of the panel containing the metadata table. */
+    static final private String CARD_ONE  = "Card One";
+    /** The name of the panel containing the 'no file' placeholder for the metadata table. */
+    static final private String CARD_TWO = "Card Two";
+    /** The name of the panel containing the 'no metadata' placeholder for the metadata table. */
+    static final private String CARD_ZERO = "Card Zero";
+    /** The name of the panel containing the placeholder for the value tree. */
+    static final private String TOOLS_OFF = "Tools Off";
+    /** The name of the panel containing the value tree. */
+    static final private String TOOLS_ON  = "Tools On";
+
     /** The GValueTree graphically shows the available metadata that has been previously assigned, and provides controls for adding, updating and removing metadata, depending on the users selections in the other important components. */
     private GValueTree tree = null;
@@ -116,19 +135,4 @@
     /** Provide synchronization between the collection trees in this view and the collection pane view. */
     private TreeSynchronizer tree_sync = null;
-    static private Dimension BUTTON_SIZE = new Dimension(190, 25);
-    static private Dimension CONTROL_SIZE = new Dimension(560, 240);
-    static private Dimension MINIMUM_SIZE = new Dimension(100, 100);
-    static private Dimension TABLE_SIZE = new Dimension(560, 25);
-    static private Dimension TREE_SIZE = new Dimension(250, 500);
-    /** The name of the panel containing the metadata table. */
-    static final private String CARD_ONE  = "Card One";
-    /** The name of the panel containing the 'no file' placeholder for the metadata table. */
-    static final private String CARD_TWO = "Card Two";
-    /** The name of the panel containing the 'no metadata' placeholder for the metadata table. */
-    static final private String CARD_ZERO = "Card Zero";
-    /** The name of the panel containing the placeholder for the value tree. */
-    static final private String TOOLS_OFF = "Tools Off";
-    /** The name of the panel containing the value tree. */
-    static final private String TOOLS_ON  = "Tools On";
 
     /** Constructor.
@@ -308,22 +312,4 @@
     public void afterDisplay() {
 	external_split.setDividerLocation(0.3);
-	if(table != null) {
-	    Dimension table_size = table.getPreferredSize();
-	    TableColumnModel column_model = table.getColumnModel();
-
-	    TableColumn inherited_column = column_model.getColumn(0);
-	    inherited_column.setPreferredWidth(20);
-	    inherited_column.setCellRenderer(new TableCellRenderer(model));
-
-	    TableColumn element_column = column_model.getColumn(1);
-	    element_column.setPreferredWidth(table_size.width / 4);
-	    element_column.setCellRenderer(new TableCellRenderer(model));
-
-	    TableColumn value_column = column_model.getColumn(2);
-	    value_column.setPreferredWidth(((3 * table_size.width) / 4) - 15);
-	    value_column.setCellRenderer(new TableCellRenderer(model));
-	}
-	table.doLayout();
-	model.fireTableDataChanged();
     }
     /** Called whenever a significant change has occured in the state of the currently loaded collection.
@@ -507,4 +493,12 @@
 	table.addMouseListener(new TableMouseInputHandler());
 
+	// We also have to ensure that the table column header hasn't gone on a severe Jenny Craig binge and has somehow lost 7/8th of its component size (15 -> 2 pixels high).
+	JTableHeader table_header = table.getTableHeader();
+	Dimension table_header_preferred_size = table_header.getPreferredSize();
+	if(table_header_preferred_size.height < MINIMUM_TABLE_HEADER_SIZE) {
+	    table_header_preferred_size.setSize(table_header_preferred_size.width, MINIMUM_TABLE_HEADER_SIZE);
+	    table_header.setPreferredSize(table_header_preferred_size);
+	}
+
 	JScrollPane table_scroll = new JScrollPane(table);
 	table_scroll.getViewport().setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
@@ -806,6 +800,6 @@
 	}
 
-	table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
 	if(table != null) {
+	    table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
 	    Dimension table_size = table.getPreferredSize();
 	    TableColumnModel column_model = table.getColumnModel();
@@ -816,9 +810,9 @@
 
 	    TableColumn element_column = column_model.getColumn(1);
-	    element_column.setPreferredWidth(TABLE_SIZE.width / 4);
+	    element_column.setPreferredWidth((TABLE_SIZE.width / 4) - 15);
 	    element_column.setCellRenderer(new TableCellRenderer(model));
 
 	    TableColumn value_column = column_model.getColumn(2);
-	    value_column.setPreferredWidth(((3 * TABLE_SIZE.width) / 4) - 15);
+	    value_column.setPreferredWidth(((3 * TABLE_SIZE.width) / 4) - 30);
 	    value_column.setCellRenderer(new TableCellRenderer(model));
 	}
