GWT and YUI are two completely different things, both are pretty good
at what it is they do, but they don't do the same thing at all.
GWT is a toolkit for building AJAX client apps starting from a
statically typed compiled language, Java. With GWT you build not only
your UI, but also your controller, your model, your entire app, and it
all "lives" on the client. Then when you need to talk to the server to
get/sync/update data ,a serialization mechanism for Java backends is
provided too (you can also "talk" to other server resources as well).
GWT gives you all the inheritance, tooling, testing and so on support
that comes with Java, and a starting point for building your entire
app in the "rich" desktop vein. When you use GWT in the canonical
fashion, you don't even care that your app ends up as JavaScript, you
never have to worry about that (you still have the freedom to get into
that level if you want, and you could quite easily, for example, wrap
a lot of the UI stuff from YUI as a GWT module using JSNI).
YUI is a pure JavaScript client library. Also impressive, but a
different approach. I suppose YUI could be used as an alternative, to
build your entire app on the client (back to controller and model
there as well, not just UI), leaving the server side up to any other
XHR setup, but that's definitely a different tack.
I am not saying one is better than the other, but I think for building
a total application GWT makes more sense in my mind. YUI seems more
appropriate to add a widget to an existing app, or as something you
might want to incorporate in various other ways, but not build
entirely from (but then again, personally, I wish to avoid directly
having to work with JavaScript when possible, thats one of the things
I like about GWT, maybe it's me). Also, I know you CAN build entirely
from YUI, or pure JavaScript, just saying, I prefer the static
approach, starting from Java and generating JavaScript, and all the
benefits that offers.