O'Reilly logo

Java™ ME Game Programming, Second Edition by Ph.D. Martin J. Wells, Ph.D. John P. Flynt

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

Canvas

The Canvas class is in some ways analogous to the Form class. You create an instance of the Canvas class and then call the Display::setCurrent() method to make it active. After you have activated the Canvas object, you then have access to the primary method of the Canvas class: the paint() method. The paint() method is defined so that it receives an argument of the Graphics type. Figure 13.1 provides a simplified overview of some of the activities you can perform using Graphics objects.

Figure 13.1. The Canvas and Graphics classes allow you to create and display a variety of items.

Table 13.1 discusses several of ...

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