简体   繁体   English

什么是Java Swing应用程序的一个很好的例子?

[英]What's a good example of a Java Swing application?

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. 我有兴趣在Swing中编写一些Java应用程序。 What are some projects that use a clean document layout so that I can see how one normally structures a Java application? 有哪些项目使用干净的文档布局,以便我可以看到通常如何构建Java应用程序?

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 reviews and 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. 请注意,您实际上可以获得版本1和版本2的代码示例。此外,您可以在Word中免费获得该书的第一版。 On a final note, if you get to really like Swing, have a look at Griffon too. 最后一点,如果你真的喜欢Swing,那也看看Griffon吧。 It makes coding Swing applications a whole lot nicer because it uses a Groovy DSL. 它使Swing应用程序的编码变得更好,因为它使用了Groovy DSL。 Good luck. 祝好运。

Here's a very simple guessing game that shows the pattern. 这是一个非常简单的猜谜游戏 ,展示了这种模式。 This somewhat more complex tile game was designed to illustrate the same concepts. 这个稍微复杂的平铺游戏旨在说明相同的概念。

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 these projects...they've provided whole source code for each project...take any of them which interests you and you can understand the framework that way... 查看这些项目......他们已经为每个项目提供了完整的源代码......采取您感兴趣的任何一个,并且您可以通过这种方式理解框架......

Each Swing application is typically solving a different problem with a different approach. 每个Swing应用程序通常使用不同的方法解决不同的问题。 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. 在添加功能时,请查看创意示例,但仅仅因为一个项目以某种方式实现解决方案,并不意味着始终是最好的方式,或者它甚至是适合您情况的选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM