In the heart of writing a moderate sided Swing app at the moment, and it’s a jungle in there. You’ve got Panels, Models, Frames, Event Handlers, Actions. It’s easy to get into trouble quickly.

All that stuff is pretty straightforward in a small forms based app. But when you add a stack of complex panels and models things start getting very busy. Has anyone read any good articles on writing maintainable swing apps? Or has worked on any moderate sized swing apps and has some good battle-tested tips to share?

My latest thinking is to explore IoC frameworks like Spring to see if I can externalise a lot of the magic to an understandable XML file (eg the Actions would becoming much cleaner rather than manually injecting their related panels/models/or whatever from some other code deeply nested inside a Panel class somewhere). Even the Panel creation logic would probably become a little cleaner.

Interested to hear ideas from people who’ve walking this scary road.