Clojure Example Swing App

(See my full list of Clojure Swing examples and tutorials at Clojure Swing Interop)

Here is a full app demonstrating use of Swing from Clojure. Toy apps usually gloss over import code. For example, real Swing requires proper use of the event thread, and combining multiple layout types to get more complex behavior.

Clojure Swing Temperature Conversion App
An example app using Clojure Swing to convert temperatures.

Here’s the full source.

Note that #(<some UI code>)  is used to pass in a function to the event dispatch thread, otherwise you have null pointer exceptions due to the code being executed BEFORE it is passed to the event dispatch thread.

Leave a Reply

Your email address will not be published. Required fields are marked *