import javax.microedition.midlet.*; import javax.microedition.lcdui.*; import javax.microedition.media.*; import javax.microedition.io.*; public class main extends MIDlet { public InputStream is; public Player pl; public void startApp() { Form f=new Form("media"); Display.getDisplay(this).setCurrent(f); try{ is=getClass().getResourceAsStream("/m.mid"); pl=Manager.createPlayer(is,"audio/midi"); f.append("ok"); pl.realize(); pl.setLoopCount(-1); f.append("ok"); pl.prefetch(); pl.start(); f.append("ok"); } catch(Exception me){ f.append("media"); } } public void pauseApp() { } public void destroyApp(boolean unconditional) { } }