什么是 Java Swing 应用程序的好例子?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4234428/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What's a good example of a Java Swing application?
提问by Georg Sch?lly
I'm learning Java at my university, but unfortunately only the language and not really the framework.
我在我的大学学习 Java,但不幸的是只学习语言,而不是真正的框架。
I'm interested in writing some Java applications in Swing. What are some projects that use a clean document layout so that I can see how one normally structures a Java application?
我有兴趣在 Swing 中编写一些 Java 应用程序。有哪些项目使用干净的文档布局,以便我可以看到人们通常如何构建 Java 应用程序?
采纳答案by trashgod
Here's a very simple guessing gamethat shows the pattern. This somewhat more complex tile gamewas designed to illustrate the same concepts.
回答by JGFMK
One of the things I usually do for things like this is look at Amazon for book reviews. For the ones with favourable feedback, I then go to the publishers website and download the source code. So for this question I'd take a look at these reviewsand the publishers website. Note you can actually get the code examples for versions 1 & 2. Also you can get the first edition of the book for free in Word. On a final note, if you get to really like Swing, have a look at Griffon too. It makes coding Swing applications a whole lot nicer because it uses a Groovy DSL. Good luck.
我通常为这样的事情做的一件事是查看亚马逊的书评。对于那些有好评的,我然后去出版商网站下载源代码。所以对于这个问题,我会看看这些评论和出版商网站。请注意,您实际上可以获得版本 1 和 2 的代码示例。此外,您还可以在 Word 中免费获得本书的第一版。最后,如果您真的喜欢 Swing,也可以看看 Griffon。它使 Swing 应用程序的编码变得更好,因为它使用 Groovy DSL。祝你好运。
回答by jzd
Each Swing application is typically solving a different problem with a different approach. Therefore there is not a typical structure that is always used. I would suggest instead of looking for a standard structure, just start small and build some simple projects. As you add features look at examples for ideas, but just because one project implements a solution in a certain way, doesn't mean that is always the best way, or that it is even an appropriate choice for your situation.
每个 Swing 应用程序通常使用不同的方法解决不同的问题。因此,没有始终使用的典型结构。我建议不要寻找标准结构,而是从小处着手并构建一些简单的项目。当您添加功能时,请查看示例以获取想法,但仅仅因为一个项目以某种方式实现了解决方案,并不意味着这总是最好的方式,或者它甚至是适合您情况的选择。
回答by Eternal Noob
I found one simple Tic-Tac-Toe done in MVC, it may be helpful to you understanding MVC pattern.
我在 MVC 中找到了一个简单的Tic-Tac-Toe,它可能对您理解 MVC 模式有所帮助。
EDIT:
编辑:
Check out theseprojects...they've provided whole source code for each project...take any of them which interests you and you can understand the framework that way...
查看这些项目......他们为每个项目提供了完整的源代码......选择其中任何一个你感兴趣的项目,你就可以这样理解框架......