Mebuat Tampilan Gambar Pada J2ME

//Format image yang hanya bisa di baca hanya PNG,JPG.


import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class ImageExample extends MIDlet implements CommandListener {
    Display display;
    Form imageForm;
    Command exitCommand = new Command("Exit", Command.EXIT, 1);
    DateField dateonly,timeonly,datetime;
    Ticker ticker = new Ticker("JENI - Java Education Network Indonesia");
    public ImageExample(){
        imageForm = new Form("ImageItem");
        imageForm.addCommand(exitCommand);
        imageForm.setCommandListener(this);
        imageForm.setTicker(ticker);
        try {
            Image img = Image.createImage("/JENI.png");
            ImageItem image =
            new ImageItem("JENI", img, Item.LAYOUT_CENTER, "jeni logo");
            imageForm.append(image);
        } catch (Exception e){e.printStackTrace();}
    }
    public void startApp() {
        if (display == null){
            display = Display.getDisplay(this);
            display.setCurrent(imageForm);
        }
    }
    public void pauseApp() {}
    public void destroyApp(boolean unconditional) {}
    public void commandAction(Command c, Displayable d){
        if (c == exitCommand){
            destroyApp(true);
            notifyDestroyed(); // Exit
        }
    }
}

Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

0 comments:

Post a Comment

 

© 2010 Rasta Shared. All rights resevered. Designed by Templateism

Back To Top