如何组织一个Swing GUI应用程序? [英] How to organize a Swing GUI application?

查看:270
本文介绍了如何组织一个Swing GUI应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经写了几GUI的使用Swing和我知道MVC的,但我从来没有发现真正整理我的code莫名其妙的好方法。我所寻找的是类似Maven在每个新项目引入了文件夹结构。另一个例子是导轨,其中,MVC是通过文件夹结构自动引入。是否有摆动相似的地方?

I've written a few GUI's using Swing and I know about MVC, but I never found a good way to really organize my code somehow. What I am looking for is something like the folder structure that maven introduces for each new project. Another example is rails, where MVC is introduced through the folder structure automatically. Is there something similar for Swing?

这也将是很高兴看到一本书,描述了一个更大的Swing应用程序的开发。所有我看到的是有关的设计指南的书籍,其中的设计指的是应用程序的外观。其他Swing书籍(如O'Reilly出版)中详细描述了所有Swing组件,但如果是对大画面的任何信息?

It would also be nice to see a book that describes the development of a larger Swing Application. All I find are books about design-guidelines where design refers to the look of the application. Other Swing books (like O'Reilly) describe in detail all the swing components, but where is any information about the big picture?

是否有一个Swing GUI的,在那里你会说:这就是你如何组织code /文件夹/包摆动!任何好的例子?

Are there any good examples of a swing gui, where you'd say "That's how you organize code/folders/packages for swing!"?

编辑:我发现下面的网站http://www.ibm.com/developerworks/java/tutorials/j-springswing/section7.html它描述春天的使用,同时创建一个GUI。这是一个相当古老的例子,它并没有回答我的问题,但它是一个步入正确的方向。它还提到春天RCP,但我不知道这是否可能是解决方案。

I found the following site http://www.ibm.com/developerworks/java/tutorials/j-springswing/section7.html which describes the usage of spring while creating a GUI. It is a quite old example and it doesn't answer my question, but it is a step into the right direction. It also mentions Spring RCP, but I'm not sure if it could be the solution.

EDIT2:我还没有找到任何更好的答案。有谁知道一个理想的结构Swing GUI的是开放源代码的例子吗?有谁知道一本书,它描述了吗?如果不是摇摆,那么也许对GUI的总体?

I still didn't find any better answers. Does anybody know an example for a ideally structured Swing GUI which is Open Source? Does anybody know a book, which describes it? And if not for Swing, then maybe for GUI's in general?

推荐答案

虽然的Groovy ,不是的Java ,我建议你看一看的格里芬,这是一个的的摆动Grails的

Although it is Groovy, not Java, I would advise you take a look at Griffon, which is a "Grails for Swing".

它强制执行给定结构(在目录和模式方面, MVC 特别),以你用它所有的应用程序。

It enforces a given structure (in terms of directories and patterns, MVC in particular) to all applications you build with it.

我认为它可以给你在总体上是好的想法,但你将不得不进行一些小的调整到Java。

I think it can give you good ideas in general, although you would have to perform some little adaptation to Java.

此外,请注意,格里芬还支持Java应用程序的建设,它也可以提供原型对于这一点,所以你可以检查为好。

Besides, please note that Griffon also supports Application building in Java, and it may also provide "archetypes" for that, so you could check that as well.

这篇关于如何组织一个Swing GUI应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆