O'Reilly logo

Core Java® Volume II—Advanced Features, Ninth Edition by Gary Cornell, Cay S. Horstmann

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

2.7.4. An Example: Generating an SVG File

Listing 2.10 on p. 165 is a typical program that produces XML output. The program draws a modernist painting—a random set of colored rectangles (see Figure 2.6). To save a masterpiece, we use the Scalable Vector Graphics (SVG) format. SVG is an XML format to describe complex graphics in a device-independent fashion. You can find more information about SVG at www.w3c.org/Graphics/SVG. To view SVG files, simply use any modern browser.

Image

Figure 2.6. Generating modern art

We don’t need to go into details about SVG; for our purposes, we just need to know how to express a set of colored rectangles. Here is a ...

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