AWT is dead now

Cedric Berger
Mon Mar 20 22:25:00 GMT 2000

Per Bothner wrote:

> > 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.
> It seems plausible to use libart (see
> and ).

Wow, this looks great!

> > 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.
> Well, this is the "pure Java" approach.  It may make sense
> to use existing Gtk widgets instead.  It may also make sense
> to do provide both:  I.e. the toolkit by default uses Gtk
> widgets, but that can be overridden.

What is the real advantage of Gtk over "pure Java"? Speed?
What can you do with Gtk that you can't do with "pure Java"?
I must say that I don't know a lot about Gtk (unfortunatly, the
only native toolkit I've ever programmed so far is Win32/MFC)
but having used Swing a lot, I can see a lot of adventages of
"pure Java" over any native toolkit.

> I think the "model" classes should be pure Java (except perhaps
> a few CNI methods for speed).  However, the "view" classes
> should perhaps be based on gtk widgets.  At least the default
> implementation of the view classes should use the gtk theme
> framework.

Do you thing it is feasible to implement that? Again, I don't know
Gtk very well, but I would have troubles doing that with Win32.

And it is sometimes interresting to be able to modify the "view"
part of a widget. If I take again my example of syntax coloring;
I've been able to implement that very easily with Swing because
I've change the *view* part of the simple (plain) text pane: the
document remains a list of lines of ascii text (without style info)
and I've just overriden the drawLine() method of the View. No
need to insert style info or anything special into the "model"

> One exciting idea I want to explore is to use the XSL
> "formatting object" model for views.  See
> We could base the implementation on FOP ( ),
> which is an open-source implementation in Java sponsored by the Apache
> XML Project.  FOP can generate pdf - and it also includes
> a viewer, so it could form the basis for a "view engine".
> (However, I don't know if the Apache license is viewed as
> being compatible with the modified-GPL of libgcj.)

I'm not quite sure I understand what you mean: the FOP viewer
is built on top of Java2D, but kind of GUI widget do you want to
build with FOP?
Or do you thing about generating PDFs from Java2D? that would
be very cool!


More information about the Java mailing list