Skip to content

Instantly share code, notes, and snippets.

@juergenhoetzel
Created June 6, 2010 15:14
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 juergenhoetzel/427650 to your computer and use it in GitHub Desktop.
Save juergenhoetzel/427650 to your computer and use it in GitHub Desktop.
(ns joy.gui.DynaFrame
(:gen-class
:name joy.gui.DynaFrame
:extends javax.swing.JFrame
:prefix df-
:implements [clojure.lang.IMeta]
:state state
:init init
:constructors {[String] [String]}
:methods [[display [java.awt.Container] void]
^{:static true} [version [] String]])
(:import (javax.swing JFrame JPanel) (java.awt BorderLayout Container)))
(defn df-init [title]
[[title] (atom {::title title})])
(defn df-meta [this] @(.state this))
(defn version []
"1.0")
(defn df-display [this pane]
(doto this
(-> .getContentPane .removeAll)
(.setContentPane (doto (JPanel.)
(.add pane BorderLayout/CENTER)))
(.pack)
(.setVisible true)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment