File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Build large Swing application? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Build large Swing application?" Watch "Build large Swing application?" New topic

Build large Swing application?

david zhang

Joined: Oct 12, 2003
Posts: 27
I need to build a large Swing application. I have read some
tutorial books and articles, but each of them has only examples,
or very small example applications, none
of them revealing the considerations and practical
techniques in buiding large Swing applicaitons, or
none of them talking about these things systematically.
By considerations and techniques I mean
what patterns are most often used in what places.
how to manage many screens?
how to build fast applications.
application initialization.
general application structure.
I would be very grateful if anybody could provide any informaiton
about related sites or links or articles or books.
Thanks very much in advance!
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
A very ggod book about Swing is Swing 2nd ed. by Matthew Robinson and Pavel Vorobiev. It has some medium size examples, and most of them are solutions to real problems a programmer might deal with.
A suggestion about how to face a real project could be Applying UML and Patterns by Craig Larman.

SCJP2. Please Indent your code using UBB Code
Chris Shepherd
Ranch Hand

Joined: Jun 27, 2000
Posts: 286
I don't know any good books that deal with large apps, But I have written (what I consider to be) a very large app that comes in at about ~20k lines. One of the most important things I have learned is plan out as much as possible, but be willing to leave the plan if you need to.
It sounds like you are new to java, are you new to programming? Alot of standard coding techniques also appliy to java as well.
It really sounds like you need to grow this project, not just write it. Start with something simple like Bringing up a JFrame with a Hello world label or something easy like that. Get your feet wet and learn the basics. Ask questions here, or more importantly (and faster usually) search to see if the question has already been answered. This seems like a really simplistic aproach, but start easy and work up to the multiple windows/program structure. Build it to work first. Then tweak it to work fast.
What kind of a project is it?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

One of the biggest complaints about SWING apps is how it performs. And in this regard, it is of my opinion from what I have read that you really need to know how SWING threads work and how the event model in SWING works. Because the performance in your app will bottleneck when you process event requests from things like clicking buttons, menuitems, etc.
Here is an article you might want to read. While I don't agree with the approach the article takes on dealing with the event thread, it does give a very good build up and discussion on how it actually works and some ways to possibly deal with it.

GenRocket - Experts at Building Test Data
david zhang

Joined: Oct 12, 2003
Posts: 27
Jose, Chris, and Gregg,
Please accept my sincere thanks for your information and advice.
I have done a lot of Java programming, but not in the Swing area.
I am either quite familar with or aware of patterns and many
other things.

My project is related to mining business data. Though
little experience in develop large-scale Swing app, I can somehow
quickly feel it if something does not go quite right. Very often,
I can "figure out" a solution. I personally feel constant refactoring
is fun and somehow an addiction. However, I still hope to
get things as right as possible at the beginning.
I feel there is lack of information/books in the Java Swing area that
gives a systematic/decent description of the tricks/techniques
for doing things
I mentioned in my previous message (another thing:
for instance, what is the often used approach to maintain menu item
enabling/disabling status, state machine?)
"plan out as much as possible, but be willing to
leave the plan if you need to" is very true. I hope to know what
options are and have a hopefully viable plan at the beginning....
I agree. Here's the link:
subject: Build large Swing application?
It's not a secret anymore!