• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Screen not getting refreshed

 
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic