sto cercando di imparare il j2me ma non avendo un buon manuale ho un ppo di problemi.
non riesco a rendere visibile il prodotto del metodo paint(Graphics g);
ecco il codice:
codice:import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class HelloMIDlet extends MIDlet implements CommandListener { private Command exitCommand; // The exit command private Display display; // The display for this MIDlet private Image image = null; private int width = 0; private int height = 0; public HelloMIDlet() { exitCommand = new Command("Exit", Command.EXIT, 0); } public void startApp() { } protected void paint(Graphics g) { g.setColor(0, 0, 255); g.fillRect(0, 0, width, height); display = Display.getDisplay(this); } public void pauseApp() { } public void destroyApp(boolean unconditional) { } public void commandAction(Command c, Displayable s) { if (c == exitCommand) { destroyApp(false); notifyDestroyed(); } } }

Rispondi quotando