import javax.microedition.media.*; import javax.microedition.media.control.*; import javax.microedition.lcdui.*; import java.io.*; /*Автар: Мега Гений*/ public class PLR extends Canvas { int w,h; Image FON, BALL; Player PLR; public PLR() { setFullScreenMode(true); w = getWidth(); h = getHeight(); try { FON = Image.createImage ("/img/fon/FON.png"); BALL = Image.createImage ("/img/ball/BALL.png"); PLR = Manager.createPlayer (getClass() .getResourceAsStream("/plr/PLR.mid"), "audio/midi"); PLR.realize(); PLR.prefetch(); PLR.setLoopCount(-1); PLR.start(); getState(); setLoopCount(int); getDuration(); getMediaTime(); setMediaTime(int); getCountType(); dellocate(); } catch (Exception ex) { ex.printStackTrace(); } } public void paint(Graphics g) { g.setColor(0xfff100); g.fillRect(0,0,w,h); g.drawImage(FON, 0, 0, 20); g.setColor(255,0,0); // g.drawImage(BALL, w/2, h/2, Graphics.HCENTER | Graphics.VCENTER); // //g.drawString("ВЫХОД - 0",0,h/2,20); repaint(); } public void keyPressed(int keyCode) { if (keyCode==48) Main.midlet.destroyApp(true); } public void keyRepeated(int keyCode) {} }