Clojure Desktop Displaying Labels
2018-12-29 17:54 更新
可以在标签类的帮助下显示标签。 下面的程序显示了如何使用它的示例。
(ns web.core
(:gen-class)
(:require [seesaw.core :as seesaw]))
(defn -main [& args]
(defn display
[content]
(let [window (seesaw/frame :title "Example")]
(-> window
(seesaw/config! :content content)
(seesaw/pack!)
(seesaw/show!))))
(def label (seesaw/label
:text "This is a label too"
:background :white
:foreground :black
:font "ARIAL-BOLD-10"))
(display label))在上面的代码中,首先创建一个来自翘板库标签类的标签变量。 接下来,标签的文本设置为“这也是标签”。 然后,相应地设置背景,前景色和字体。
当上面的代码运行时,你会得到以下窗口。

以上内容是否对您有帮助:

免费 AI IDE


更多建议: