Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

serviceRepaints()  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
maybe someone has an idea!?!

--------------------------------------------------
public class test extends Canvas {

int paintCount = -1; // because setCurrent(canvas) calls paint() too

public void run() {
try {
Display.getDisplay(this.midlet).setCurrent(this);
repaint();
repaint();
serviceRepaints();
if (paintCount == 0) System.out.println("error");
}

public void paint(Graphics g) {
paintCount++;
System.out.println(paintCount);
}
}
--------------------------------------------------

the result is:
0
error
1

The method paint() is only executed ones for two calls of repaint(). So far so good. Printing the paintCount indicate that paint() did run. Now, why does serviceRepaints() not wait until the paint() method has finished ???
Im running this in simulation with WTK2.0.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!