ВУЗ:
Составители:
Рубрика:
67
Структура мидлета может быть представлена следующим образом:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class MIDPSkeleton extends MIDlet implements Comman-
dListener
{
private Command quit; // The Quit command
private Display display; // Declaring the display
// Initialize the Display and place system controls in the
Constructor
public MIDPSkeleton()
{
display = Display.getDisplay(this);
quit = new Command("Quit", Command.SCREEN, 2);
}
/**
* Initialize all the classes to be used in the program here
(startApp())
*/
public void startApp()
{
...
...
}
// If the Application needs to be paused temporarily.
public void pauseApp()
{
...
...
}
// Clean up when the application is destroyed.
public void destroyApp(boolean unconditional)
{
...
...
}
// Event handling routine.
public void commandAction(Command c, Displayable s)
{
if (c == quit) // If Quit button is pressed.
{
notifyDestroyed(); // Call the destroyApp method.
}
}
}
Страницы
- « первая
- ‹ предыдущая
- …
- 65
- 66
- 67
- 68
- 69
- …
- следующая ›
- последняя »
