TonttuMIDlet.java
上传用户:kyckim
上传日期:2007-12-11
资源大小:332k
文件大小:1k
源码类别:

通讯/手机编程

开发平台:

Java

  1. package Tonttu;
  2. import javax.microedition.lcdui.Display;
  3. import javax.microedition.lcdui.Displayable;
  4. import javax.microedition.media.Player;
  5. import javax.microedition.midlet.MIDlet;
  6. public class TonttuMIDlet extends MIDlet {
  7. static TonttuMIDlet tonttuMIDlet;
  8. static PlayerCanvas playerCanvas;
  9. static FilerForm filerForm;
  10. public TonttuMIDlet() {
  11. tonttuMIDlet = this;
  12. playerCanvas = new PlayerCanvas();
  13. filerForm = new FilerForm();
  14. Display.getDisplay(this).setCurrent(playerCanvas);
  15. }
  16. public void startApp() {
  17. }
  18. public void pauseApp() {
  19. if(playerCanvas.player != null) {
  20. if(playerCanvas.player.getState() == Player.STARTED) {
  21. try {
  22. playerCanvas.player.stop();
  23. playerCanvas.repaint();
  24. } catch(Exception e) {
  25. playerCanvas.closePlayer();
  26. }
  27. }
  28. }
  29. }
  30. public void destroyApp(boolean flag) {
  31. }
  32. public void exitApp() {
  33. try {
  34. destroyApp(true);
  35. notifyDestroyed();
  36. } catch(Exception e) {
  37. }
  38. }
  39. }