Clojure - Desktop Changing the Value of Text



The value of the content in the window can be changed by using the ‘config!’ option. In the following example the config! option is used to change the window content to the new value of “Good Bye”.

(ns web.core
   (:gen-class)
   (:require [seesaw.core :as seesaw]))
(def window (seesaw/frame
   :title "First Example"
   :content "hello world"
   :width 200
   :height 50))
(defn -main
   [& args]
   (seesaw/show! window)
   (seesaw/config! window :content "Good Bye"))

When the above code is run, you will get the following window.

Good Bye
clojure_applications.htm
Advertisements