Swing GUI Development with Spring

Viewed 28808

Are there any decent tutorials out there for building Swing GUI applications using Spring (v3 preferably)?

1 Answers

It is possible, but if you want to work with a GUI-builder, you can't initialize any GUI composites by spring. So you can't use such things like dependency injection! Spring managed beans must be get out of the spring context manually.

I did this years ago, so i guess, it is currently the correct way! I had a global/static InitializationManager which initializes and holds the spring context. When I need a bean managed by spring, I called a static method of the InitializationManager public static <T> T getBean(final Class<T> requiredType).

Not very elegant, but it works stable!

Hope this helps after the long time.

Related