Skip to content

Instantly share code, notes, and snippets.

@tlrobinson
Created July 17, 2018 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tlrobinson/84533de28c6eaf27f89cf04c0f616470 to your computer and use it in GitHub Desktop.
Save tlrobinson/84533de28c6eaf27f89cf04c0f616470 to your computer and use it in GitHub Desktop.
java swing in clojure hello world
(javax.swing.SwingUtilities/invokeLater (fn []
(let [frame (new javax.swing.JFrame "HelloWorldSwing")
label (new javax.swing.JLabel "Hello World")]
(.setDefaultCloseOperation frame javax.swing.JFrame/EXIT_ON_CLOSE)
(.add (.getContentPane frame) label)
(.pack frame)
(.setVisible frame true))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment