Index: /trunk/src/tmcsim/client/cadclientgui/screens/IncidentViewer.java
===================================================================
--- /trunk/src/tmcsim/client/cadclientgui/screens/IncidentViewer.java	(revision 310)
+++ /trunk/src/tmcsim/client/cadclientgui/screens/IncidentViewer.java	(revision 414)
@@ -3,6 +3,8 @@
 import java.awt.Color;
 import java.awt.Dimension;
+import java.awt.Event;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
@@ -12,11 +14,22 @@
 import java.util.Date;
 import java.util.Stack;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.swing.AbstractAction;
+import javax.swing.ActionMap;
 import javax.swing.BorderFactory;
 import javax.swing.ImageIcon;
+import javax.swing.InputMap;
 import javax.swing.JButton;
+import javax.swing.JTextArea;
+import javax.swing.JTextPane;
+import javax.swing.KeyStroke;
 import javax.swing.ListSelectionModel;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
 import javax.swing.table.DefaultTableModel;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.StyledDocument;
+import spikes.TextComponentDemo;
 import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_ADD_INFO;
 import tmcsim.client.cadclientgui.enums.CADDataEnums.INC_CALLBACK;
@@ -54,4 +67,5 @@
         initLayout();
         initControllers();
+        addBindings();
     }
 
@@ -305,9 +319,12 @@
                     upperCommentBox.setText("");
                 }
-                close();
+                else // Exit the window
+                {
+                    close();
+                }
             }
         };
     }
-
+                    
     public DocumentListener newCommentsDocumentListener()
     {
@@ -318,7 +335,7 @@
             }
 
-            public void insertUpdate(DocumentEvent e)
+            public void insertUpdate(DocumentEvent evt)
             {
-                commentsNotesSaveButton.setEnabled(true);
+                commentsNotesSaveButton.setEnabled(true);           
             }
 
@@ -706,5 +723,6 @@
         commentsNotesField.setLineWrap(true); // JD make text wrap inside the field
         commentsNotesField.setBorder(BorderFactory.createLineBorder(Color.GRAY)); // JD added a border
-
+        upperCommentBox.setLineWrap(true); 
+        
         commentsNotesAddButton.setText("Add");
         commentsNotesCancelButton.setText("Cancel");
@@ -2160,4 +2178,27 @@
         ScreenManager.refreshIncidentEditor();
     }
+    /** Add key binding to upper comment box to catch Enter key
+     *  and save the comment, then clear the field.
+     */
+    protected void addBindings() 
+    {
+        InputMap inputMap = upperCommentBox.getInputMap();
+        ActionMap actionMap = upperCommentBox.getActionMap();
+        // Watch for Enter key
+        KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
+        inputMap.put(key, "clearAction");
+        actionMap.put("clearAction", new ClearAction());
+    }
+    /** Custom Action to clear a JTextPane, used to clear upperCommentBox */
+    class ClearAction extends AbstractAction 
+    {
+        public void actionPerformed(ActionEvent evt) 
+        {
+            JTextArea src = (JTextArea) evt.getSource();
+            saveComment(src.getText().toUpperCase());
+            src.setText(""); // clear the text area
+        }
+    }
+
     // Variables declaration - do not modify//GEN-BEGIN:variables
     private javax.swing.JPanel activitiesPane;
