jQuery in Action, 2nd edition
The moose likes Java Micro Edition and the fly likes Screen not getting refreshed Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Reply Bookmark "Screen not getting refreshed" Watch "Screen not getting refreshed" New topic
Author

Screen not getting refreshed

Danish Shaukat
Ranch Hand

Joined: Nov 16, 1999
Posts: 337
Hi !
I am trying to use low-level graphics. Just a simple midlet that draws a rectangle. The problem is that it draws on the previous screen. The screen is not getting refreshed. You can see my code below.
Danish
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17225
    
    1

Took me a while to realize what you meant by it draws on the previous screen. You mwan the screen with the name of your MIDlet, that it doesn't clear that out before drawing your rectangle.
I had had that problem when I first created a canvas, then I realized that for the Canvas, you need to clear the screen with code like this

Now that setColor, you want to change the numbers to whatever color you want the background to be. It fills in a rectangle that is the size of the screen.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Screen not getting refreshed
 
Similar Threads
Help Needed on animation in j2me
Java ME game creation help
Detect "dial" button pressed from J2ME program
Short Example of Fullscreen Graphics
anyone used Canvas + graphics ?