@yedefei About the multi threading part: I also used to think this would just be fine, but clearly, it isn't. None of Greenfoot APIs are thread safe, so you have to do much work to let it be safe.
Davmac told me this, and has a useful scenario:
http://www.greenfoot.org/scenarios/1963
to show the amount of code for thread safety.
If you want to do more with threads, you should really dive into the books.
Just some big advice from me
thanks,and another question: how to get the focus of my panel?e.g. In this demo ,there is no responding when I press keys until clicking the panel of mine ,how to solve?
If you really want to get access the the JPanel of the World, look at this scenario:
http://www.greenfoot.org/scenarios/2828
but if I were you, just import:
import greenfoot.*;
and use the default Greenfoot APIs.
2012/8/7
2012/8/7
2012/8/7
2012/8/7
2012/8/7
2012/8/7
2012/8/7
2012/8/7