Skip to content

Instantly share code, notes, and snippets.

@Chouser
Created December 5, 2008 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chouser/32536 to your computer and use it in GitHub Desktop.
Save Chouser/32536 to your computer and use it in GitHub Desktop.
(ns org.drewolson.dragon
(:gen-class
:extends javax.swing.JFrame))
(defn -paint [this graphics]
(prn :paint-called)
(doto graphics
(.drawString "Hello, World" 20 20)))
(defn -main []
(let [dragon (new org.drewolson.dragon)]
(doto dragon
(.setSize 300 300)
(.setVisible true))))
; -- or --
(ns org.drewolson.dragon
(:gen-class))
(defn -main []
(let [dragon (proxy [javax.swing.JFrame] []
(paint [graphics]
(prn :paint-called)
(doto graphics
(.drawString "Hello, World" 20 20))))]
(doto dragon
(.setSize 300 300)
(.setVisible true))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment