• 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

What happened to my Canvas when callSerially

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My Canvas like this:
public class somec extends Canvas implements Runnable{
.....
public void showNotify(){
running = true;
new Thread(this).start();
}
......
public void run(){
while(running){
....
repaint();
callSerially(this) //Warning here,"this" is not Runnable?!!
.......
}
}
public void paint(Graphics g){
.....
}
}
}
What is the problem here? How can I fix it ?
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As stated in "J2ME in a Nutshell" - "The code to be executed in the event thread should be implimented in the run() method of the Runnable passed to the callSerially() method."
What that says to me is if your "this" is not runnable nothing will be executed
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic