     column    _viewport column
   Returns the model index"
            [column]
-           (let [ col-model (.getColumnModel table)
-                  table-col (.getColumn col-model column)]
-             (.getModelIndex table-col)))
+           (let [ col-count (.getColumnCount table) ]
+             (if (>= column col-count) column
+               (let [ col-model (.getColumnModel table)
+                      table-col (.getColumn col-model column)]
+                 (.getModelIndex table-col)))))
          
          :get-index-column
          (fn-swing-doc "Returns the column in the view that corresponds

                  cols (range (.getColumnCount col-model))
                  matching (filter 
                             (fn [x] (= index (.getModelIndex (.getColumn col-model x))))
                             cols)]
             (first matching)))

         :get-index-row
         (fn-doc "Returns the row in the view that corresponds

   with the widget as first parameter and the given additional parameters"
  [map key & parameters]
  `(((~map :handler) ~key) ~map ~@parameters))

(defmacro map!
  "Just like map, but not lazy."
  [f & colls]
   `(seq (map ~f ~@colls)))


;;;
