   "Removes given menus (as Java objects) from menu-bar of frame."
   [^JFrame frame, menus]
   (do-swing
-   (let [menu-bar (first (select frame [:JMenuBar])),
+   (let [^JMenuBar menu-bar (first (select frame [:JMenuBar])),
          new-menus (remove (set menus) (seq (.getComponents menu-bar)))]
      (.removeAll menu-bar)
      (doseq [^JComponent menu new-menus]

(ns conexp.contrib.gui.util
  (:import [javax.swing JFrame JPanel JButton ImageIcon JTabbedPane 
                        JLabel BorderFactory AbstractButton JFileChooser
                        JOptionPane JComponent]
           [javax.swing.filechooser FileNameExtensionFilter]
           [java.awt Color Dimension Graphics Graphics2D BasicStroke FlowLayout]
           [java.awt.event MouseEvent]

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