Line-by-line Anatomy of HelloMIDlet.java
(Cont.)
import javax.microedition.midlet.*;
The package javax.microedition.midlet defines MIDP applications and the interactions between the application and the environment in which the application runs.
Class hierarchy
public class HelloMIDlet extends MIDlet implements CommandListener {
- The class javax.microedition.midlet.MIDlet is a MIDP application.
The application must extend this class to allow the application management software to control the MIDlet and to be able to retrieve properties from the application descriptor and notify and request state changes.
- The interface javax.microedition.lcdui.CommandListener is used by applications which need to receive high-level events from the implementation.
An application will provide an implementation of a
Listener
and will then provide an instance of it on a Screen
in order to receive high-level events on that screen.
private Display display;
The class javax.microedition.lcdui.Display represents the manager of the display and input devices of the system.
It includes methods for retrieving properties of the device and for requesting that objects to be displayed.
private TextBox tbxMain;
The class javax.microedition.lcdui.TextBox is a Screen that allows the user to enter and edit text.