Back to Applets page
Click in the boxes below, select all and copy to grab the applet
HTML listing:
<HTML> <HEAD> <TITLE>Listing 11.2</TITLE> </HEAD> <BODY BGCOLOR=WHITE> <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- Hide script from old browsers sWidth = 0 sHeight = 0 sRes = 0 if (navigator.appName == "Netscape" && navigator.javaEnabled()) { defToolkit = java.awt.Toolkit.getDefaultToolkit() sWidth = defToolkit.getScreenSize().width sHeight = defToolkit.getScreenSize().height sRes = defToolkit.getScreenResolution() } if (sWidth == 0 || sHeight == 0 || sRes == 0) { sWidth = 640 sHeight = 480 sRes = 96 } document.writeln("<H1>Your screen dimensions are " + sWidth + " x " + sHeight + ", with a resolution of " + sRes + " dpi.</H1>") // End hiding script from old browsers --> </SCRIPT> </BODY> </HTML>