> Hi All,
> And I am having a lot of problems organizing my swing code. Is there
> any framework that i can use to build a well-organized swing
> application which makes it easy to maintain.
If I understand this question, try Netbeans or Eclipse. Netbeans, on
download, handles swing (It's what I use). Eclipse has many plug ins.
Jeff Coffield
harshalenator - 22 May 2006 14:23 GMT
Hi Jeffrey,
Many thanks for your response.
What I am going to build is a small swing application. NetBeans, as far
as what people told me, is as an over kill for a small swing
application. And our management prefers hand coding for swing and any
drag and drop editor to build swing components is avoided, but we do
use eclipse ide to write code.
So, how can NetBeans help me in this situation. Or is there another
alternative. My main problem is organizing the code.
Thank you very much.
Ray Tayek - 23 May 2006 04:39 GMT
> ...
> So, how can NetBeans help me in this situation. Or is there another
> alternative. My main problem is organizing the code.
the best way to organize your code is:
http://en.wikipedia.org/wiki/Model-view-controller.
the best way to insure that you do this without making a mess is to
write a command line controller (use gnu getopts to parse) and a command
line view (just use printf's).
thanks
Thomas Weidenfeller - 23 May 2006 09:02 GMT
> the best way to organize your code is:
> http://en.wikipedia.org/wiki/Model-view-controller.
A way, often a good way, not necessarily the best way for all possible
applications. Like other possible architectures MVC has drawbacks.
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
Karsten Lentzsch - 23 May 2006 10:05 GMT
> the best way to organize your code is:
> http://en.wikipedia.org/wiki/Model-view-controller.
> [...]
MVC is one of the available patterns for organizing
the application presentation logic. It is definitely
not the best way to organize code - in all contexts -
and there are other patterns that are as important
as MVC, MVP or Presentation Model. For example
"Separated Domain".
And Swing doesn't use MVC at the component level.
Instead it uses something like M-JComponent-(VC).
Since most Swing components provide useful model
abstractions, the "Presentation Model" (PM) pattern
may hide information and reduce complexity better
than MVC or MVP. Hiding information with PM comes
at a price and the costs differ with the size and
organization of the application.
In my opinion there's no one-size-fits-all pattern
that is ideal for everyone. I recommend to study
the known patterns and experiment a little with them
before starting a larger application.
-Karsten
Ray Tayek - 24 May 2006 01:54 GMT
> > the best way to organize your code is:
> > http://en.wikipedia.org/wiki/Model-view-controller.
> > [...]
>
> MVC is one of the available patterns for organizing
> the application presentation logic.
sure, there are flavours listed in your faq:
http://java.sun.com/products/jfc/tsc/articles/architecture/index.html
> And Swing doesn't use MVC at the component level.
> Instead it uses something like M-JComponent-(VC).
yes, a variation.
and things can get messy:
http://www.danmich.com/mvcmediator/1.0/wp/white_paper.html
http://www.jgoodies.com/articles/binding.pdf
starting with a model (subject) and a command line (observer) view and
controller helps me keep things from turning into spaghetti.
thanks
harshalenator - 24 May 2006 11:52 GMT
Thank you all,
Thanks Karsten for your suggestions, JGoodies is awesome. You and your
team have done a great job. I wanted to appreciate and thank your work
from a very long time, got a chance today.
There's lot more to swing than just adding the components...
Thank you all once again.
:: Hi All,
::
[quoted text clipped - 17 lines]
::
:: Thank you.
The free packages are:
a.. JGoodies Animation
a.. JGoodies Binding
a.. JGoodies Forms
a.. JGoodies Looks
a.. JGoodies Validation
Are demos you can load down to give you directions on good design.
Skeleton
Skeleton Pro
Metamorphosis
Forms Demo
Looks Demo
Validation Demo
The JGoodies Suite is the produce for cost.
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
> [...]
> Which of the above things are free and open source and which ones are
> not.
IchBin has provided the correct list of free and open source libs
and no-charge binary demos that can help you design your apps.
> [...]
> And I am having a lot of problems organizing my swing code. Is there
> any framework that i can use to build a well-organized swing
> application which makes it easy to maintain.
Several things can help you get started with Swing.
If found that a basic understanding of desktop patterns
and desktop architectures helps a lot. And I recommend
to learn about Model-View-Presenter (MVP), not MVC,
"Presentation Model", "Separated Domain", "Autonomous View".
Then study architectures for these patterns - which should
take a day or so. A good narrative that motivates all
the above is Martin Fowler's "Organizing Presentation Logic".
Google these three words to get a reference.
I provide a bunch of presentations about desktop patterns,
data binding, Swing problems, at the JGoodies articles page:
http://www.jgoodies.com/articles/
The most recent versions of the "Desktop Patterns and
Data Binding" presentation is here: http://tinyurl.com/n7z9t
Once you have the patterns and architecture, you may pick
a bunch of helper libs to improve the appearance, reduce
your layout time and costs, validate data, bind data,
perform operations in the background. If you are new to Java
I'd bind data "by hand", not with an automatic binding.
Next, you may want to learn how to combine all the above.
Scott Delap book "Desktop Java Live" that describes the
patterns, architectures; he mentiones example libs for
the appearance, layout, etc. And describes a small
application where he brings these techniques together.
I provide the sources of the Skeleton and Skeleton Pro apps
as part of the commercial JGoodies Swing Suite. These show
how to tie things together for reasonable large applications.
I demonstrate many techniques and solutions in demo apps
and do not necessarily put them in a framework, primarily
to keep the amount of application helper classes small.
Where a flexible and powerful framework requires significantly
more modules, classes, documentation and learning time.
Larger desktop frameworks are the Eclipse RCP (most parts
require the SWT), Netbeans RCP (quite large), and the
Spring RCP (version 0.1 is now avaible).
-Karsten