       (.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.))

         (.fireTableStructureChanged (.getModel (components :presets-table)))
         (set-preferred-column-width (components :presets-table)))))


;; test/run

(defn start

(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")
