O'Reilly logo

Platinum Edition Using XHTML™, XML, and Java™ 2 by Andrew H. Watt, Mike Morgan, Jim O'Donnell, Eric Ladd

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Putting It All Together—The Art Display Applet

Now that you've seen how the various graphics primitives work, you can put them together to build a graphics-intensive applet. Suppose an art dealer has hired you to build a Web site that displays pieces of art online. In addition to showing the art, the dealer wants to allow customers to select a frame and matte. You might write the HTML shown in Listing 38.5.

Code Listing 38.5. Frames.html—The User Chooses a Frame, Matte, and Piece of Art to Display
 <HTML> <HEAD><TITLE>Demo of Frames</TITLE></HEAD> <SCRIPT LANGUAGE="JavaScript"> <!-- // set the applet's frame property based on the value selected function setFrame(theObject) { //alert("got: " + theObject.options[theObject.selectedIndex].value); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required