Clojure 中的 Desktop – Displaying Te

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

文本字段可以在文本类的帮助下显示。以下程序显示了有关如何使用它的示例。

(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 textfield
      (seesaw/text
         :text "This is a text field"
         :editable? false
         :columns 50))
   (display textfield))

在上面的代码中,首先创建一个文本字段变量,该变量来自seesaw库的文本类。接下来,将文本字段的文本设置为"This is a text field"。

clojure desktop button


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

技术教程推荐

朱赟的技术管理课 -〔朱赟〕

玩转Spring全家桶 -〔丁雪丰〕

TypeScript开发实战 -〔梁宵〕

Node.js开发实战 -〔杨浩〕

安全攻防技能30讲 -〔何为舟〕

检索技术核心20讲 -〔陈东〕

Python自动化办公实战课 -〔尹会生〕

React Hooks 核心原理与实战 -〔王沛〕

Go 语言项目开发实战 -〔孔令飞〕

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