可以在標(biāo)簽類的幫助下顯示標(biāo)簽。 下面的程序顯示了如何使用它的示例。
(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))
在上面的代碼中,首先創(chuàng)建一個來自翹板庫標(biāo)簽類的標(biāo)簽變量。 接下來,標(biāo)簽的文本設(shè)置為“這也是標(biāo)簽”。 然后,相應(yīng)地設(shè)置背景,前景色和字體。
當(dāng)上面的代碼運(yùn)行時,你會得到以下窗口。
更多建議: