 (defn current-tab-title
   "Returns the currently selected tab's title and nil if there is none."
   [frame]
-  (let [^JTabbedPane tabpane (get-tabpane frame),
+  (let [tabpane (get-tabpane frame),
         index (.getSelectedIndex tabpane)]
     (if (= -1 index)
       nil

(defn get-tabs
  "Returns a vector of all tab of the given frame."
  [frame]
  (let [^JTabbedPane tabpane (get-tabpane frame)]
    (vec (rest (seq (.getComponents tabpane))))))

(defn add-tab-with-name-icon-tooltip
  "Addes given panel to the tabpane of frame, giving name icon and tooltip"
  [^JFrame frame, ^JPanel pane, name icon tooltip]
  (do-swing
   (.addTab ^JTabbedPane (get-tabpane frame) name icon pane tooltip)
   (.validate frame)))

(defn remove-tab
  "Removes a panel from the windows JTabbedPane."
   [^JFrame frame, ^JPanel pane]
   (do-swing
    (.remove ^JTabbedPane (get-tabpane frame) pane)
    (.validate frame)))

(defn current-tab

  "Addes given panel to the tabpane of frame with given title, if given."
  ([^JFrame frame, ^JPanel pane, ^String title]
     (do-swing
      (let [tabpane (get-tabpane frame)]
        (.add tabpane pane)
        (let [index (.indexOfComponent tabpane pane),
              title (if-not (.isEmpty title)
