O'Reilly logo

Programming Wireless Devices with the Java™ 2 Platform, Micro Edition, Second Edition by Jim Holliday - Editor, Aleksi Uotila, Mark Patel, Jyri Huopaniemi, Jim Van Peursem, Antero Taivalsaari, Roger Riggs

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

11.1. The Canvas API

To directly use the display and the low-level user interface API, the developer uses the Graphics and Canvas classes. The Canvas class provides the display surface, its dimensions, and callbacks used to handle key and pointer events and to paint the display when requested. The methods of this class must be overridden by the developer to respond to events and to paint the screen when requested.

The Graphics class provides methods to paint lines, rectangles, arcs, text, and images to a Canvas or an Image.

The combination of the event-handling capabilities of the Canvas and the drawing capabilities of the Graphics class allows applications to have complete control over the application region of the screen. These low-level classes ...

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