Phlip said:
Because I have experience with the best OO GUI toolkits, and Swing can't do
what they do, at the level of the language itself.
Beyond that, I have almost no experience with Swing itself, and I do not
doubt that a Java expert can use it elegantly, reliably, and robustly.
That's because Sun invented Java by removing the features from C++ that make
it fast. I can easily write programs that never fault (modulo whatever
compiler and platform they use). And I can crash a Java program with one arm
tied behind my back.
Download and run many GUI libraries, in many languages. You must learn much
more than Swing before you even start your project. Even download Amulet (if
you can find it), Frog, FLTK, and Fox. And run them in different languages.
If you design a library when all you know is Swing and C++, you will make
many mistakes that other libraries show the fixes for.
--
Swing is one of the best designed library (The next is Qt ofcourse). I
had worked with a vast range of gui library, like Swing, AWT, SWT from
Java, Qt, wxWidgets , VCF, FLTK, UCPP, GTK+, Motif etc from C++ world
as well as TCL/TK & Python from script world. If one want to have some
heavy GUI based application , scripting is just not possible (I wil
definitely stop using OpenOffice or MS Office if they make the GUI
using TCL/TK). Moreover they have very poor look on many platform (
check Ansys on Windows) and have incomplete functionality. Even most of
the time they are actually wrapper for C/C++ library. Note that major
GUI library are C/C++ or Java only. However scripting language has
their place. When I have some academic signal procesing application and
just want to show the result in some GUI I use TCL/TK for that.
Moreover with advanced C++/Java framework and so beautifule editors &
form designers, there is no disadvantage of the heavyweight language
based GUI. Now it is much faster to design an very sophisticated GUI
with Netbeans or Ecplice than to design it in Python or TCL/TK or
Python.
Secondly, If you want to get best design for GUI framework look at
Swing, Java and VCF. They gives absolutely flexibility to implement
whatever you like, in minimum time.
GTK+ is very well designed C library (not OO library). wxWidgets is the
worst designed (after Motif & MFC !) but vastly supported GUI
framework. It runs in very old to very new PC. If there is a partial
implemented C++ compiler for a platform , it is going to support it.
Thus it never use standard OO concepts, and standard C++ concepts
(which has both advantage & disadvantage). Most modern GUI framework
for C++ after Qt is VCF , which looks much like Swing, but still under
development. And it integrates AGG , thus one can have very fast
beautifull 2D graphics. One can look at its existing Windows & Mac
port.
The other C++ framework like UCPP and smooth (and few other) has a
different stack based approach for GUI , thus they seems to be little
faster. However they lacks flexibility (they are new one and yet under
development). However as they do some most mordern way to design it
(and do many static compilation based on template, they may have a
larger exe size and compilation time, but have faster runtime response,
and may be smaller memory footprint). If one is going to develop some
C++ GUI framework, one should look at this approach also before
starting anything.
And finally Swing is the library for standard design. It has best
design no doubt. If you sit with a GOF book and Swing library, you can
look how beautifully the whole thing fits into it (even much better
that its own ET++ or PresentationManager examples). And if anyone says
it is not possible to do something with Swing, they are either saying
false, or don't know Swing. Other than doing something platform
specific (which can anyway be implemented with a platform API binding)
Swing can do everything. One can create stunning effect, large scale UI
based application and what not? Look the Sun JavaONE Show examples, or
Project Looking Glass, or Swing Hacks book to see what Swing can do.
They can have better effect than Vista Aero (MS has done it with 6
years development with such a huge team).
So in my suggestion the way Swing, Qt and VCF works is beautiful and
very flexible. C framework GTK+ is no doubt the king. The different
kinds of framework like UCPP also needs some attention. And apart from
small UI, scripting language do not give any advantage over C++ or Java
or Delphi (Pascal) . They are based on the wapped C++ api.
abir