I normally go to the swing tutorials on Sun's website when I have questions.

I'm writing a GUI in clojure. I'm using IntelliJ's (not great) FormDesigner.

Clojure is in some sense 'on top of' Java, since it uses the Java libs.
Writing a Swing GUI in Clojure hasn't been that much different than writing it 
in java, except that you can automate away a lot of the ceremony that Swing so 
loves.

Many people hate layout managers and just lay things out with XYLayout.
It certainly makes it easier to lay something out if you're not using a visual 
designer type package.

The only real trick to using swing is understanding that most everything that 
modifies the UI has to happen in the event thread. So, if you, say, have a 
cancel button in a dialog for a long operation, and the cancel button goes away 
when the operation completes (assuming the dialog stays open, maybe to display 
some results) then you need to use SwingWorker to run the code that removes the 
button in the proper thread.
Fortunately this doesn't apply to most property settings, so if you change the 
text in a label or turn a button green you're OK.

And of course if you click a button and that makes another button go away, 
that's fine, since you're already IN the event thread.





      

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to