AWT is dead now

Cedric Berger
Mon Mar 20 20:59:00 GMT 2000

Nobody uses AWT widgets anymore. I've never seen a new AWT
application the last two years. In fact, Swing is widely recognized
as the better GUI toolkit availabe today (and I'm not speaking of
Java only). The main problem so far was speed, but JDK 1.3 is
much better, and having the code compiled with a tool like GCJ
will also make it much faster.

There has been a lot of discussion about AWT vs Swing design
option, and I think that most people agree that Swing has two
major advantages over AWT:
1) platform independence: you don't need to test thing on many
platform, the code is the same, the bugs are the same, ...
2) flexibility: there is not a single part of the Swing library that
I cannot replace or subclass in an application. Syntax coloring,
for example, can be done with 20-50 lines of code, by just
replacing the text RENDERER.

IMHO, the right way to develop a graphic library for Java today

1) implementing the basic (low level) AWT functionalities.
Basically Window/Frame/Component/Container/Canvas and
event handling.

2) implementing Java2D (it's probably more difficult than 1),
but it can be done later and its probably a lot of fun to do.

3) implementing Swing on top of the minimal AWT (or
borrowing it from 1.1 as a temporary solution). Swing is not
a trivial piece of code, but the advantage is that since almost
all functions/members of Swing are either public or protected,
all the skeleton of the code can be written from the JavaDoc
output of swing. "only" filling the method's body is required.

4) if somebody really need it at that point, implementing
AWT widgets by calling Swing code: I believe that it is (or
was) Sun's plan too.


Tom Tromey wrote:

> >> Secondly, I'm quite interested in doing some work on implementing
> >> AWT (I'm more intrested in Client stuff myself). I was wondering if
> >> someone could clear up the position of this, esp. regarding the
> >> Classpath merger. I seem to recall that everything from Classpath
> >> is available except the AWT code.  Now is this all AWT code or just
> >> the native implementation? IF I do use it what is the final result?
> >> That the executable is cover by the GPL? I can live with that for
> >> now...
> Jeff> From looking at Warren Levy's latest patches, I'd guess that the
> Jeff> libgcj maintainers haven't given up on doing their own AWT port,
> Jeff> independently of classpath.
> Warren's recent patches notwithstanding, we haven't started
> implementing AWT.  Those were needed for something else.
> Jeff> AWT would be great... you might consider a portable toolkit
> Jeff> (GTK?)  though before it becomes too Win32-centric, so that
> Jeff> other platforms can benefit.
> My goal is to have a retargetable AWT -- one where we can plug in
> different back ends.  So we might have a Gtk+ back end (the one I'd
> like to see :-), a Windows back end, and even a back end running on a
> framebuffer (for embedded folks).  I don't know enough about AWT to
> say whether this is a realistic plan.
> Tom

More information about the Java mailing list