我这里有一小段代码。
(ns experiments
(:import (javax.swing JFrame JLabel)))
(defn create-frame [title text]
(doto (JFrame. title)
(.add (JLabel. text))
(.pack)
(.setDefaultCloseOperation JFrame/EXIT_ON_CLOSE)
(.setVisible true)))
现在我运行一个 REPL(Clojure Box,基本上是 emacs + slime),从正确的类路径开始,等等,调用(使用'experiments) - 这有效 - 然后调用
(create-frame "Foo" "Bar")
.
然后……什么都没有。REPL 永远挂断,没有帧出现,什么也没有。