J2ME, reapint() -> redraw, how to clear screen?

Discussion in 'Java' started by Boki, Apr 14, 2005.

  1. Boki

    Boki Guest

    Hi All,

    J2ME, reapint() -> redraw, how to clear screen? ( CLS )

    Thanks!

    Best regards,
    Boki.
     
    Boki, Apr 14, 2005
    #1
    1. Advertisements

  2. Boki

    Mike Guest

    J2ME, reapint() -> redraw, how to clear screen? ( CLS )

    Graphics g ...
    ..set color...
    g.fillRect( 0, 0, g.getWidth(), g.getHeight());
     
    Mike, Apr 14, 2005
    #2
    1. Advertisements

  3. Boki

    Boki Guest

    Hi,
    Got the idea, thanks.
    So, I guess we don't have clear screen command here, right ? :)

    another question,
    if I want to command g of graphic in other plaec ( run(), startApp(),
    xxxxx() )...
    I have to reference it ?

    Example will helpful to me :D

    Best regards,
    Boki.
     
    Boki, Apr 14, 2005
    #3
  4. Boki

    Mike Guest

    Mike, Apr 14, 2005
    #4
  5. In your Canvas.paint(Graphics) method, set the color in the Graphics
    object and then call fillRect(0,0,getWidth(),getHeight()).
     
    Darryl Pierce, Apr 16, 2005
    #5
  6. No. Once paint() exits, the Graphics object is invalid and should not be
    used.
     
    Darryl Pierce, Apr 16, 2005
    #6
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.