Appletviewer

This is in response to the question I had written last week about getting an error message when trying to use the Appletviewer. The HTML code I used was:

This works fine when I look at it using a browser. However, when I use the Appletviewer it doesn’t work and was the cause of my error message that I asked about last week. I finally figured out to use the following HTML code

When I used this code the Appletviewer finally worked. Does anyone know why this is? Also many books tell you to use the latter code is there any reason? Thanks