You may want to check-out Dave Ray's seesaw . "Seesaw turns the Horror of Swing into a friendly, well-documented, Clojure library"
https://github.com/daveray/seesaw -FS. On May 10, 2012, at 3:03 PM, JvJ wrote: > Hi, > > I'm new to Clojure, but a longtime Java programmer. I'm trying to get > the hang of gen-class, and I'd like to write a custom JFrame that > extends the paint method so I can get some ***aw3xX0m3 gr4f-X***. > > Anyways, I'm having some trouble understanding gen-class, inheritance, > etc. > > Here's what I have so far: > > (import '(javax.swing JFrame) > '(java.awt Graphics) > '(java.awt.event WindowAdapter)) > > (ns LifeFrame) > > (gen-class > :name LFrame > :extends javax.swing.JFrame > :constructors {[String] [String]} > :state state > :prefix lFrame-) > > ;;; Draw a black rectangle > (defn lFrame-paint [this gfx] > (.fillRect gfx 0 0 100 100)) > > (defn mainRun [] > (let [f (LifeFrame/LFrame.)] > (.setVisible f true)));; Run the constructor > > When I call mainRun from the REPL, I get the following error: > > CompilerException java.lang.IllegalArgumentException: Unable to > resolve classname: LFrame, compiling:(LifeFrame.clj:24) > > > Any knowledge about this would be greatly appreciated. > > Thanks. > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en