11

I'm learning Java at my university, but unfortunately only the language and not really the framework.

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?

Georg Schölly
  • 124,188
  • 49
  • 220
  • 267

4 Answers4

3

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. 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.

JGFMK
  • 8,425
  • 4
  • 58
  • 92
2

Here's a very simple guessing game that shows the pattern. This somewhat more complex tile game was designed to illustrate the same concepts.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
0

I found one simple Tic-Tac-Toe done in MVC, it may be helpful to you understanding MVC pattern.

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...

Eternal Noob
  • 2,717
  • 5
  • 27
  • 41
  • 1
    I know MVC well enough, I'm just not familier with swing and how one structures an application normally. E.g. what different packages do you create normally? It think the fastest way for me to get a feel for Java+Swing is to look at a well done project. – Georg Schölly Nov 20 '10 at 20:35
  • Thanks for your effort, but I know how to use a search engine myself. I was asking this question here *specifically* because I wanted some code that *someone with experience* thinks is well written and easy to understand. By just googling or searching on sourceforge one finds a lot of badly written code and I, as a beginner, can't judge the quality of code. – Georg Schölly Nov 21 '10 at 20:00
0

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.

jzd
  • 23,473
  • 9
  • 54
  • 76