Can Spring and SWT work together for Java Desktop Applications?

耗尽温柔 提交于 2019-12-04 03:11:11

In java desktop land, you have 2 major choices : Swing or SWT. I'm ignoring AWT on this one. QTJambi is not that used in Java.

Most Java desktop applications use Java Swing. Nothing is preventing you from using an IOC container in a desktop application. In general, IOC container are used mostly to store event listeners, actions in desktop applications and barely UI components.

There are many attempts to create Swing RCP frameworks but most Java desktop applications kind of roll their own.

ThaDon

You definitely can use Spring and reap the benefits of its various features including IoC. Spring is definitely not confined to the webworld, that's one of its great selling features is it's the swiss army knife of Java frameworks.

You realize, of course, that SWT is not portable the way that Swing is.

Yes, you can use Spring with SWT, but there's no built-in MVC framework to help you. You might find the Spring Rich Client module helpful.

Here's a simple example - one person's opinion.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!