Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swing GUI Development with Spring

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

like image 666
Pram Avatar asked Mar 01 '26 09:03

Pram


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.

like image 58
Thilo Schwarz Avatar answered Mar 03 '26 22:03

Thilo Schwarz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!