Wednesday, October 31st, 2007
} } class ColorGenerator { // This class is needed to produce colors that the pie chart can use to // color the slices properly. They are taken from the NetCharts color // class, NFColor. public ColorGenerator() { } int color_count = -1; // Keep a running count of the colors we have used. We’ll simply index // the colors in a String array, and call up the incremented counter to // get a new color. If you need more colors than are added below, you can // add more by pulling them from the NFColor class found in the NetCharts // package on the CD-ROM or Web site. String colors[] = {”aliceblue”,”antiquewhite”,”aqua”,”aquamarine”,”azure”,”beige”, “bisque”,”black”,”blanchedalmond”,”blue”,”blueviolet”,”brown”,”chocolate”, “cadetblue”,”chartreuse”,”cornsilk”,”crimson”,”cyan”}; public String next() { // Increment the color counter, and return a String which contains the // color at this index. color_count += 1; return colors[color_count]; } } // end example72.java Summary This chapter has shown you how to generate meaningful charts to represent data obtained from a query. We ve seen how to create both bar and pie charts. You can use the properties of the NetCharts package to customize your charts as you wish, and there are many more options in the package that haven t been shown in the examples here. In the next chapter, we will continue to discuss working with database query results, and we will provide a complete code example for showing SQL BLOB data types. It shows you how to get an image from the ResultSet, as well as how to add images or binary data to a table in a database. Chapter 8 The IconStore Multimedia JDBC Application
A musical ensemble is, by definition, a group of three or more musicians who gather to perform music. There are several denominations of ensembles according with their size and composition.Check band web hosting, and see why we are one of the best resources on the web for finding web hosting providers quickly and easily.