Skip to content

Instantly share code, notes, and snippets.

Created Oct 8, 2012
What would you like to do?
A Swing example in Clojure
(ns swing
(:import [javax.swing JFrame JLabel JButton]
[java.awt.event WindowListener]))
(defn swing []
(let [frame (JFrame. "Fund manager")
label (JLabel. "Exit on close")]
(doto frame
(.add label)
(.setDefaultCloseOperation JFrame/EXIT_ON_CLOSE)
(proxy [WindowListener] []
(windowClosing [evt]
(println "Whoop"))))
(.setVisible true))))
(defn -main [& args]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment