O'Reilly logo

Kicking Butt with MIDP and MSA: Creating Great Mobile Applications by Jonathan Knudsen

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

9. Creating Custom Screens

IF the plain old LCDUI screens are not sufficiently jazzy or flexible for your application, you can create your own screen using a canvas. It’s more work, but it’s more fun. You can control almost all of the drawing on the display and you get fine-grained event information as well.

The Canvas class is a lot like the other screens, a descendent of the Displayable class. This means that it can have commands, a title, and a ticker.

You can’t just create a canvas directly, as you can with other screens. Canvas is an abstract class, with a single abstract method, paint(). You must write a subclass of Canvas and define a paint() method that draws whatever you want. Then you can create an instance of your canvas and show it ...

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