• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

wait and then change the picture

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there,

consider i have an image on the canvas. i want the user when he clicks 2 on the keypad for example, i want the canvas to wait for about one second and then change the the image. I tried using Thread.sleep(1000) and then changing the picture reference and then calling repaint() method. But here i get a problem, the canvas always changes the picture and gets repainted and then gets idle for one second. In java stand edition, i use to use timers and calling it everytime "start and stop", but in J2ME i read that the timer won't work properly when called sequentially.

can somebody help me?
 
Ranch Hand
Posts: 904
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

A hack would be to introduce a state value. In the block, that gets
excecuted when the user presses "2" you'll sleep for 1000 ms, then
change the state.



Do report back if the above doesn't work, or is a bad approach

/Svend Rost
 
reply
    Bookmark Topic Watch Topic
  • New Topic