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

Display and Displayable

The Display class provides the foundation for visual interaction with a MIDlet. There can be one and only one instance of the Display class in a MIDlet. The Display object allows you to communicate with the device and to provide a context in which to display visible screen components. To obtain an instance of the display, you use the getDisplay() method. This method is static and returns an object of the Display type. A call to the getDisplay() takes the following form:

Display display = Display.getDisplay(this);

The this keyword identifies the current instance of the MIDlet class. Table 9.2 furnishes a summary of a few of the methods in the interface of the Display class. The Display()::getCurrent() method returns an ...

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