This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "clear screen in MIDP" Watch "clear screen in MIDP" New topic

clear screen in MIDP

glen kaatz

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?
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
It is sorta covered in the JavaRanch Style Guide.
subject: clear screen in MIDP
Similar Threads
Swing drawing
what api
clear dynavalidator form
MySQL - clear screen command
what api