import javax.microedition.midlet.MIDlet; import javax.microedition.lcdui.Display; import javax.microedition.lcdui.Form; import javax.microedition.lcdui.Command; import javax.microedition.lcdui.CommandListener; import javax.microedition.lcdui.Displayble; import javax.microedition.lcdui.Image; import javax.microedition.lcdui.Ticker; import java.io.IOExñeption; public class SlideShow extends MIDlet implements CommandListener { private Display display; private Form form; private Command next; private Command back; private Image image; private int slideNunm; private int maxSlideNum=5; public void startApp() { display = Display.getDisplay(this); form = new Form(null); form.setCommandListener(this); next = new Command("Back", Command.BACK, 1); form.addCommand(back); Ticker t = new Ticker("My Photoalbum"); form.setTicker(t); setImage("/1.png"); display.setCurrent(form); } public void commandAction(Command c, Displayble d) { if (c == next && slideNum1) slideNum--; form.delete(0); setImage("/"+integer.toString(slideNum)+".png"); } public void setImage(String path) { try { image = Image.createImage(path); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } form.append(image); } } public void pauseApp() { } public void destroyApp(boolean b) {} } }