                                      default-properties)))
   (watcher/stop!)
   (watcher/load-state! "wer.edn")
-  (-> main-window ui/pack! ui/show!)
+  (-> main-window swing/pack! swing/show!)
   (let [tournaments (watcher/get-tournaments)]
     (update-tournaments! tournaments)
     (doseq [tournament tournaments

  (enable-buttons id)) 

(def about-window
  (ui/frame
    :on-close :dispose
    :title "About MTG pairings"
    :size [100 :by 100]
    :content (ui/border-panel 
               :vgap 5
               :hgap 5
               :border ""
               :north "This is the WER database sniffer and result uploader"
               :south (ui/button :text "Close" :listen [:action (fn [event] (-> about-window ui/hide!))]))))
  
(defn about-handler [event]
  (-> about-window ui/pack! ui/show!))

(defn exit-handler [event]
  (System/exit 0))

(defn apikey-window []
  (ui/dialog
    :option-type :ok-cancel
    :title "API key"
    :size [300 :by 100]
    :content (ui/text :id :key
                      :text (property :api-key))
    :success-fn (fn [p] (let [value (ui/text (ui/select (ui/to-root p) [:#key]))]
                          (set-property! :api-key value)))))

(defn apikey-handler [& args]
  (-> (apikey-window) ui/pack! ui/show!))

(defn new-version-window []
  (ui/dialog
    :type :warning
    :content "Pairings-ohjelmasta on uusi versio. Lataa uusi versio painamalla OK."
    :success-fn (fn [p] 

  (let [name (:name (watcher/get-tournament tournament-id))] 
    (if track?
      (.addTab tabbed-pane name (create-tab tournament-id))
      (let [tab (swing/select (swing/to-root tabbed-pane) [(id->selector (tab-id tournament-id))])]
        (.remove tabbed-pane tab)))))

(defn tournament-table-model [tournaments]
