I mean, it could. But it was terribly hackish and anyways involved Javascript.
So you had one of two options:
1. Write an HTML webpage or
2. Write an empty webpage with a large Java applet in the center, which would be function as a "virtual terminal".
Both are ugly. That's why Sun created Java Web Start (IIRC), for complicated Java applications which could be loaded from the Internet.
Perhaps Google Docs could have done something like that, but I like the current UI more than the "potential Java Google Docs". The only thing Google Docs now can't do is Cntrl-S or something like that.
Also, don't forget the real reason (existing) Java Applets died - security.