            org.joda.time.LocalDate))
 
 
-(ui/native!)
+(swing/native!)
 
 (def version "0.2.0")
 

                  (System/exit 0))))

(defn new-version-handler []
  (-> (new-version-window) ui/pack! ui/show!))

(defn get-version-from-server []
  (let [url (str (-> @state :properties :url) "/version")]
    (-> @(http/get url) :body slurp edn/read-string :client)))

(def about-action (ui/menu-item :text "About" :listen [:action about-handler]))

(def apikey-action (ui/menu-item :text "API key..." :listen [:action apikey-handler]))

(def exit-action (ui/menu-item :text "Sulje" :listen [:action exit-handler]))

(def tabbed-pane (ui/tabbed-panel :tabs [{:title "Turnaukset"
                                          :content (ui/scrollable tournament-table)}]))

(def main-window
  (ui/frame
    :on-close :exit
    :title "MtgSuomi Pairings"
    :size [300 :by 300]
    :menubar (ui/menubar :items
               [(ui/menu :text "Asetukset" :items [apikey-action exit-action])]) 
    :content (mig/mig-panel
               :constraints ["fill, wrap 1" 
                             "[500!]" 

        row-sorter (doto (TableRowSorter. table-model)
                     (.setComparator 1 local-date-comparator)
                     (.setSortable 2 false))]
    (doto (swing/table :model table-model
                       :show-vertical-lines? false)
      (.setRowSorter row-sorter)
      (set-column-width 0 230)
      (set-column-width 1 100)
