Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > J2ME MIDlet Problem

Reply
Thread Tools

J2ME MIDlet Problem

 
 
Bob Rivers
Guest
Posts: n/a
 
      01-10-2004
Hi,

I'm new to J2ME and I am trying to build a simple test. I want to plot
some dots on my Motorola A388 screen.

I did the code bellow, and it works well. The problem is when I try to
use a FOR loop in order to plot several dots.

If I download and install it into the cell phone, I got an error:
A388-E1008: The downloaded J2ME applications cannot be installed.

If I use the Motorola SDK 4.0 and try to install it into the emulator,
I receive the following error message (into the console): Fatal Error:
Verification failed com/innovaction/dots/Dots::<init>@8

If I remove the loop, it works well.

Any clues?

TIA,

Bob

package com.innovaction.dots;

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

public class Dots extends MIDlet {

private Display display;
private DotsCanvas canvas;

Dots() {
canvas = new DotsCanvas();
display = Display.getDisplay(this);
}

class DotsCanvas extends Canvas {
Font font = Font.getFont(Font.FACE_MONOSPACE, Font.STYLE_PLAIN,
Font.SIZE_SMALL);

public void paint(Graphics g) {
g.setFont(font);
g.setColor(0);

int altura = canvas.getHeight();
int largura = canvas.getWidth();

System.out.println(">>>>>>>>>> ALTURA ORIGINAL : " + altura);
System.out.println(">>>>>>>>>> LARGURA ORIGINAL : " + largura);

altura = altura - (altura / 3);
largura = largura - (largura / 3);

System.out.println(">>>>>>>>>> ALTURA REDUZIDA : " + altura);
System.out.println(">>>>>>>>>> LARGURA REDUZIDA : " + largura);


int yInicial = (canvas.getHeight() - altura)/2;
int xInicial = (canvas.getWidth() - largura)/2;

System.out.println(">>>>>>>>>> yInicial : " + yInicial);
System.out.println(">>>>>>>>>> xInicial : " + xInicial);

g.drawString(".", xInicial, yInicial, 0);

for (int i = 0; i < 200; i++) {
System.out.println(">>> i : " + i);
}

g.drawLine(10, 20, 50, 20);
}

}

public void startApp() throws MIDletStateChangeException {
display.setCurrent(canvas);
}

public void pauseApp() {

}

public void destroyApp(boolean unconditional) {

}
}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
newbie: j2me, adding resources to midlet Jeff Java 3 10-12-2005 10:30 AM
J2ME Midlet NetBeans 4.1 HTTP jpuopolo@mvisiontechnology.com Java 0 09-18-2005 05:06 AM
J2ME MIDlet is limited, why not Java applications on mobile? chen_lin99@yahoo.com Java 4 04-27-2005 02:06 AM
how to deploy j2me midlet to motorola v600? Roy Java 2 04-16-2005 10:53 PM
J2ME, MIDLET, Any method to get setTicker status? (or the only way is control byself?) boki Java 2 03-23-2005 11:44 AM



Advertisments