Categories: Java | Java ME | UI | Code Examples
This page was last modified 18:10, 3 September 2007.
Image item
From Forum Nokia Wiki
The following code creates a Form with an Image Item.
import java.io.IOException; import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class Image_Item extends MIDlet { Display display=Display.getDisplay(this); public void startApp() { Form form = new Form("Form example"); try { Image Logo = Image.createImage("/images/logo.png"); //ImageItem(label,Image,layout,alternative text) ImageItem imageitem =new ImageItem("ImageItem Example",Logo, ImageItem.LAYOUT_CENTER,""); form.append(imageitem); } catch (IOException ex) { System.out.println("Exception occurred: "+ex); } display.setCurrent(form); } }
The following screen shot is an outcome.
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Getting selected itms fromthe listbox............ | ashbhatia | Symbian User Interface | 1 | 2002-10-25 07:55 |
| 在3300的模拟器上createImage的问题? | saltedfish | Other Programming Discussion 关于其他编程技术的讨论 | 3 | 2004-05-08 02:30 |
| I need help please | j_charles | Mobile Java Media (Graphics & Sounds) | 2 | 2007-02-05 16:01 |
| voi 7650, IOException on createImage | gs1284 | Mobile Java General | 3 | 2004-03-17 02:03 |
| Problems with images | statuszero | Mobile Java Media (Graphics & Sounds) | 2 | 2003-04-23 13:10 |

