Archive for the 'graphics' Category
/*————————————————–* ViewPng.java** Download and view a png file** Example from the book: Core J2ME Technology* Copyright John W. Muchow http://www.CoreJ2ME.com* You may use/modify for any non-commercial purpose*————————————————-*/import javax.microedition.midlet.*;import javax.microedition.lcdui.*;import javax.microedition.io.*;import java.io.*;
public class ViewPng extends MIDlet implements CommandListener{ private Display display; private TextBox tbMain; private Form fmViewPng; […]
July 4th, 2007 | Posted in graphics, j2me source code, midlet | No Comments
This example implements the following features in one Midlet:
Implementing Pie Charts and Bar Charts How to use multiple choices How to use exclusive lists
/* * @(#)Sample.java 1.9 01/06/08 * Copyright (c) 1999-2001 Sun Microsystems, Inc. All Rights Reserved. */
import javax.microedition.midlet.*;import javax.microedition.lcdui.*;
/* * A quick sample of graphics, commands, and event handling. */public […]
July 4th, 2007 | Posted in graphics, j2me source code, midlet | No Comments
Images can be viewed as thumbnails on wireless devices. The method below creates thumbnails from images
private Image createThumbnail(Image image) { int sourceWidth = image.getWidth(); int sourceHeight = image.getHeight();
int thumbWidth = 64; int thumbHeight = -1;
if (thumbHeight == -1) […]
July 4th, 2007 | Posted in graphics, j2me source code, midlet | No Comments
import javax.microedition.midlet.*;import javax.microedition.lcdui.*;
public class GIFDemo extends MIDlet {
private boolean boolMotion=false; private int iX=10,iY=60;
Display mDisplay; Thread th;
public void destroyApp(boolean unconditional){}
public void pauseApp() {}
public void startApp() { […]
July 4th, 2007 | Posted in graphics, j2me source code, midlet | 1 Comment
this is the script to relate RGB to gray scale
g.setGrayScale(127);System.out.println(”Red = ” + g.getRedComponent( ) + “, green = ” + g.getGreenComponent( ) + “, blue = ” + g.getBlueComponent( ));
July 4th, 2007 | Posted in graphics, j2me source code, midlet | No Comments
/*J2ME: The Complete Reference
James Keogh
Publisher: McGraw-Hill
ISBN 0072227109
*///jad file (please verify the jar size)/*MIDlet-Name: ClippingRegionMIDlet-Version: 1.0MIDlet-Vendor: MyCompanyMIDlet-Jar-URL: ClippingRegion.jarMIDlet-1: ClippingRegion, , ClippingRegionMicroEdition-Configuration: CLDC-1.0MicroEdition-Profile: MIDP-1.0MIDlet-JAR-SIZE: 100
*/import javax.microedition.midlet.*;import javax.microedition.lcdui.*;
public class ClippingRegion extends MIDlet{
private Display display; private MyCanvas canvas;
public ClippingRegion() { display […]
July 4th, 2007 | Posted in graphics, j2me source code, midlet | No Comments