Created
September 4, 2012 01:08
-
-
Save MachinesAreUs/3615461 to your computer and use it in GitHub Desktop.
Hello world in Clojure/Swing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(:use 'seesaw.core) | |
(def lbl (label "Swing App in Clojure/Seesaw")) | |
(def btn (button :text "Click me")) | |
(listen btn :action (fn [e] (config! lbl :text "You clicked me!" ))) | |
(frame :title "Hello Swing in Clojure", | |
:content (border-panel | |
:center btn | |
:south lbl | |
:vgap 5 :hgap 5 :border 5), | |
:on-close :exit) | |
pack! | |
show! ))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Se ve bien esa biblioteca externa Seesaw para Clojure. Es reciente AFAIK (2011).
La traducción en Kawa sería algo asi como:
Cabe notar que para las definiciones anteriores, Kawa no utiliza ninguna bilblioteca externa auxiliar, la cual de existir creo que simplificaría mucho mas el código así. Tal vez sería una buena idea proponer algo así como un Seesaw para Kawa.