aspose file tools*
The moose likes Java Micro Edition and the fly likes clear screen in MIDP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "clear screen in MIDP" Watch "clear screen in MIDP" New topic
Author

clear screen in MIDP

glen kaatz
Greenhorn

Joined: Apr 29, 2001
Posts: 6
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

Joined: Oct 25, 2000
Posts: 170
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() );
}

Eric Giguere
Author/Co-Author of: Mobile Information Device Profile for Java 2 Micro Edition: Professional Developer's Guide, Java 2 Micro Edition: Professional Developer's Guide and PalmTM Database Programming: The Complete Developer's Guide
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: clear screen in MIDP