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 [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en