[j2me]Canvas name

C

cutoff

Hello

I don't want display in the emulator,the name of the canvas.
How can I do?

Regards


Nik
 
D

Darryl L. Pierce,,,

cutoff said:
I don't want display in the emulator,the name of the canvas.
How can I do?

I don't understand your question. Can you rephrase it, please? What do you
mean by "the name of the canvas"? Do you mean the
javax.microedition.lcdui.Canvas class? If so, it doesn't display anything
unless you explicitly do so yourself.
 
C

cutoff

Darryl L. Pierce said:
I don't understand your question. Can you rephrase it, please? What do you
mean by "the name of the canvas"? Do you mean the
javax.microedition.lcdui.Canvas class?
Yes
I don't want display the name of the my project when the canvas of the
my micro application is displayed.

My code is:

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

public class AppMidlet extends MIDlet
{
Display display;
AppCanvas theCanvas;

public AppMidlet()
{
display = Display.getDisplay(this);
theCanvas = new AppCanvas();
}

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

public void pauseApp()
{
}

public void destroyApp(boolean unconditional)
{
}
}

and

import javax.microedition.lcdui.*;

public class AppCanvas extends Canvas
{
String mex=null;
public void paint (Graphics g)
{
mex ="Wellcome to J2me";
g.drawString(mex, 1,45, g.LEFT | g.TOP);

}
}

Now if I create a project with J2me Wireless toolKit,with name "Test",
this name appears also when I run my application and display the
canvas.
How can I avoid it ?
Thanks


Nik
 
D

Darryl L. Pierce,,,

cutoff said:
Yes
I don't want display the name of the my project when the canvas of the
my micro application is displayed.

Now if I create a project with J2me Wireless toolKit,with name "Test",
this name appears also when I run my application and display the
canvas.
How can I avoid it ?

You're not clearing the display area prior to writing your information. So,
when your MIDlet starts and your Canvas object begins writing to the
screen, it's writing on whatever's already there.

Try putting, in your AppCanvas.paint(Graphics) method, a call at the top to:

g.setColor(whatever color you want)
g.fillRect(0,0,getWidth(),getHeight());

And this will blank the screen for you.
 
C

cutoff

Darryl L. Pierce said:
You're not clearing the display area prior to writing your information. So,
when your MIDlet starts and your Canvas object begins writing to the
screen, it's writing on whatever's already there.

Try putting, in your AppCanvas.paint(Graphics) method, a call at the top to:

g.setColor(whatever color you want)
g.fillRect(0,0,getWidth(),getHeight());

And this will blank the screen for you.


Thanks a lot

Nik
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top