Created
December 5, 2008 22:42
-
-
Save Chouser/32536 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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