       (doseq [col display-columns]
         (doto (add-browser-column (:title col))
           (.setPreferredWidth (* total-width (:width col))))))
+    (println "sorted-column" sorted-column :model-column)
+    (.. table getRowSorter
+        (setSortKeys (list (RowSorter$SortKey.
+                             (.indexOf tags (sorted-column :model-column))
+                             (nth (SortOrder/values) (sorted-column :order))))))
     (-> @settings-window :columns :table
                          .getModel .fireTableDataChanged)))
 

     :locations @current-locations
     :sorted-column
       (when-let [sort-key (->> table .getRowSorter .getSortKeys seq first)]
         {:order ({SortOrder/ASCENDING 1 SortOrder/DESCENDING -1}
                   (.getSortOrder sort-key))
          :model-column (.getColumnName model (.getColumn sort-key))})}))


(defn apply-data-and-settings [collection-name settings]
  (clear-queues)

(ns org.micromanager.browser.core
  (:import [javax.swing BorderFactory JButton JComboBox JFrame JLabel JOptionPane
                        JList JPanel JScrollPane JSplitPane SortOrder
                        JTable JTextField RowFilter RowSorter$SortKey SpringLayout]
           [javax.swing.table AbstractTableModel DefaultTableModel
                              TableColumn TableRowSorter]
           [javax.swing.event DocumentListener TableModelListener]
