                                 (Thread/sleep 1000))))
         draw-fn           (if (:safe-draw-fn options) safe-draw-fn draw-fn)
 
-        on-close-fn       (let [close-fn (or (:on-close options) no-fn)]
-                            (if (true? (:exit-on-close options))
-                              (fn []
-                                  (close-fn)
-                                  (System/exit 0))
-                              close-fn))
+        on-close-fn       (or (:on-close options) no-fn)
 
         state             (atom nil)
         target-obj        (atom nil)

                                  :draw-fn draw-fn
                                  :renderer renderer
                                  :size size
                                  :target-frame-rate (atom 60)
                                  :decor decor}
                                 listeners)
        prx-obj           (quil.Applet. applet-state)]
    (doto prx-obj

  (applet-safe-exit applet)
  (javax.swing.SwingUtilities/invokeLater
    (fn []
      (when-let [frame (. applet frame)]
        (.setVisible frame false)))))


(defn- prepare-applet-frame
  [applet title renderer keep-on-top?]
  (let [truthify       #(not (or (nil? %) (false? %)))
        keep-on-top?   (truthify keep-on-top?)
        m              (.meta applet)
        close-op       JFrame/DO_NOTHING_ON_CLOSE
        f              (. applet frame)
        falsify        #(not (or (nil? %) (true? %)))]

    (doseq [listener (.getWindowListeners f)]
      (.removeWindowListener f listener))

    (doto f
      (.addWindowListener  (reify WindowListener
                             (windowActivated [this e])
