   ([]
     (start nil))
   ([group]
+    (when-let [frame (:frame @widgets)]
+      (edt (doto frame .hide .dispose)))
     (reset! widgets (show))
     (update-groups)
     (activate-groups-table @widgets)))

  (:import [javax.swing DefaultListModel JFrame JList JPanel JTable DefaultListSelectionModel
                        JScrollPane JViewport ListSelectionModel SpringLayout]
           [javax.swing.event CellEditorListener ListSelectionListener]
           [javax.swing.table AbstractTableModel]
           [java.awt Color Dimension])
  (:use [org.micromanager.mm :only [load-mm gui core edt get-config]]))

(def widgets (atom nil))

(defn get-selected-group []
  (let [row (.getSelectedRow (@widgets :groups-table))]
    (when (<= 0 row)
      (nth @groups row))))

;; swing layout 



(def group-data (atom nil))

(def widgets (atom nil))

(defn get-selected-group []
  (let [row (.getSelectedRow (@widgets :groups-table))]
    (when (<= 0 row)
      (nth @groups row))))


(defn update-group-data []
    (reset! group-data 
            (when-let [group (get-selected-group)]
