[j2me]Canvas name

Discussion in 'Java' started by cutoff, Feb 23, 2004.

  1. cutoff

    cutoff Guest

    Hello

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

    Regards


    Nik
     
    cutoff, Feb 23, 2004
    #1
    1. Advertising

  2. cutoff wrote:

    > 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.

    --
    Darryl L. Pierce <>
    Visit the Infobahn Offramp - <http://mypage.org/mcpierce>
    "What do you care what other people think, Mr. Feynman?"
     
    Darryl L. Pierce,,,, Feb 23, 2004
    #2
    1. Advertising

  3. cutoff

    cutoff Guest

    "Darryl L. Pierce,,," <> wrote in message news:<>...
    > cutoff wrote:
    >
    > > 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?

    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
     
    cutoff, Feb 24, 2004
    #3
  4. cutoff wrote:

    >> > 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?

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


    <snip code>

    > 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.

    --
    Darryl L. Pierce <>
    Visit the Infobahn Offramp - <http://mypage.org/mcpierce>
    "What do you care what other people think, Mr. Feynman?"
     
    Darryl L. Pierce,,,, Feb 25, 2004
    #4
  5. cutoff

    cutoff Guest

    "Darryl L. Pierce,,," <> wrote in message news:<>...
    > cutoff wrote:
    >
    > >> > 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?

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

    >
    > <snip code>
    >
    > > 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.



    Thanks a lot

    Nik
     
    cutoff, Feb 26, 2004
    #5
  6. cutoff wrote:

    >> 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


    No problem. Glad to have been able to help. :)

    --
    Darryl L. Pierce <>
    Visit the Infobahn Offramp - <http://mypage.org/mcpierce>
    "What do you care what other people think, Mr. Feynman?"
     
    Darryl L. Pierce,,,, Feb 26, 2004
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mchmiel
    Replies:
    2
    Views:
    3,811
    Tim Tyler
    Jul 5, 2003
  2. Oz Mortimer

    J2ME scrolling canvas?

    Oz Mortimer, Sep 17, 2003, in forum: Java
    Replies:
    6
    Views:
    8,907
    Darryl L. Pierce
    Sep 19, 2003
  3. Askari
    Replies:
    2
    Views:
    726
    Askari
    Aug 30, 2004
  4. PhilC
    Replies:
    2
    Views:
    909
    PhilC
    Oct 25, 2004
  5. Replies:
    10
    Views:
    278
    Rick Johnson
    Mar 15, 2013
Loading...

Share This Page