 (defn link-table-row-selection [table1 table2]
   (attach-selection-listener table1 #(set-selected-row table2 %))
   (attach-selection-listener table2 #(set-selected-row table1 %)))
+
+(defn double-click-for-new-row [table f]
+  (attach-double-click-listener
+    (.getParent table)
+    (fn [x y]
+      (let [r (.getBounds table)]
+        (when (> y (+ (.y r) (.height r)))
+          (f))))))
 
 (defn show []
   (let [f (JFrame. "Micro-Manager Configuration Preset Editor")

(defn scroll-pane [table]
   (let [sp (JScrollPane. table)]
    sp))

;; main stuff


      (.setModel preset-names-table (preset-names-table-model))
      (.setModel presets-table (presets-table-model))
      (link-table-row-selection presets-table preset-names-table)
      (double-click-for-new-row groups-table #(println "new row!"))
      (.setAutoResizeMode presets-table JTable/AUTO_RESIZE_OFF)
      (doto cp
        (.setLayout (SpringLayout.))
