Import javax. microedition. MIDlet. MIDlet;
The program first obtains the Display object of the device through the static display method getdisplay (), and then calls the obtained Display object.
For example:
Display display = display. getdisplay (this );
....
The User Interface object displayed on the display device is a displayable object. At the same time, the application can only have one displayable object. This displayable object is displayed on the display device, it is used to interact with the user. The referenced displayable object is called the current displayable object. You can pass the created GUI component to the Display object through the following setcurrent () Methods of display: Public void setcurrent (displayable D); Public void setcurrent (Alert alert, displayable D ); how to associate the Display object of a device with the displayable object of the graphic interface. Call the static getdisplay () method of the display object, create the form object, and call the setcurrent () method to bind the Display object to the display device. Display display = display. getdisplay (this); Form F = new form ("hi"); display. setcurrent (f );