• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

clear screen in MIDP

 
glen kaatz
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a class that extends Canvas. I want to clear the screen after I have drawn on it. I noticed there is no Graphics.clear(). How should I clear the screen?
Thanks
 
Eric Giguere
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set the background color and fill the screen, as in:
protected void paint( Graphics g )
{
g.setColor( 255, 255, 255 );
g.fillRect( 0, 0, getWidth(), getHeight() );
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic