Java Programing laungage

J2ME Projects

J2ME Project 1

Creating a J2ME Application for addImage into Form
Previous Home Next

Image Program



/*
 * Save as a addImage.java
 */
package r4r.Mobile.Basic;

import java.io.IOException;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;

/**
 * @author R4R
 */
public class addImage extends MIDlet {

    private Form form;
    private Image image;

    public addImage() {
        form = new Form("Add Image into Form");
        try {
            // Path of image [ r4r.Mobile -> scr -> j2me_logo.png ]
            image = Image.createImage("/j2me_logo.png");
        } catch (IOException ex) {
            System.out.println("Problem reading with image" + ex);
        }
        form.append(image);
    }
				

    public void startApp() {
        Display.getDisplay(this).setCurrent(form);
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }
}

 

output
Previous Home Next

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Name:
eMail:
Comment / Feedback: