Clojure 中的 Desktop – Displaying La

首页 / Clojure入门教程 / Clojure 中的 Desktop – Displaying La

可以在标签类的帮助下显示标签。以下程序显示了有关如何使用它的示例。

(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))

在上面的代码中,创建一个标签变量,该变量来自seesaw库的标签类,接下来,标签的文本设置为“This is a label too”。然后设置背景、前景色和字体。

无涯教程网

当上面的代码运行时,您将获得以下窗口。

clojure desktop button

祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)

技术教程推荐

从0开发一款iOS App -〔朱德权〕

Kafka核心技术与实战 -〔胡夕〕

DDD实战课 -〔欧创新〕

后端技术面试 38 讲 -〔李智慧〕

后端存储实战课 -〔李玥〕

Spark核心原理与实战 -〔王磊〕

物联网开发实战 -〔郭朝斌〕

快手 · 移动端音视频开发实战 -〔展晓凯〕

结构思考力 · 透过结构看表达 -〔李忠秋〕

好记忆不如烂笔头。留下您的足迹吧 :)