Are there any decent tutorials out there for building Swing GUI applications using Spring (v3 preferably)?
-
Is Spring popular at all for GUI applications? From the web it seems that this is not the case (?).– Witold KaczurbaOct 26, 2016 at 9:38
1 Answer
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.