Oppure

Loading
02/03/08 18:57
Pask_82
Non riesco a visualizzare l'immagine in un Form anche se l'ho inserta nella cartella RES ed ha dimensioni in pixel 32*32.
Ho bisogno di aiuto Per Favore!!!
Questo è il codice:

import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import javax.microedition.lcdui.*;

public class TestImage extends MIDlet {
    Display display;
    Image img=null;
    Form form=new Form("Image";);
    
    public TestImage() {
        display=Display.getDisplay(this);
        try{
            img=Image.createImage("_dukeok2.png";);
        }
            catch(Exception e){System.out.println("Errore caricamento immagine";);}
            
    }

    protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
        // TODO Auto-generated method stub

    }

    protected void pauseApp() {
        // TODO Auto-generated method stub

    }

    protected void startApp() throws MIDletStateChangeException {
        ImageItem temp = new ImageItem ("questa e' un img",img,
                                        ImageItem.LAYOUT_CENTER,null);
        form.append(temp);
        display.setCurrent(form);

    }

}
aaa