asyncexec和syncexec一个是异步,一个是同步, 他们的区别通过看单词的意思就可以知道。 如果不了解同步和异步是什么意思, 用文字解释就有点麻烦, timerExec(int milliseconds, Runnable runnable) Causes the run() method of the runnable to be invoked by the user-interface thread after the specified number of milliseconds have elapsed. timerexec相当于启动一个定时创建并执行线程的定时器,上面一句是帮助文件中的, 看看帮助就什么都明白了。
//you code
});把你要写的代码放 you code里。注意 .ascyxxx 这个单词拼错了,我现在不在自已电脑前。。
反正eclipse有语法提示,你看一下,像这个的就是了。。^___^
使用display类的asyncExec或syncExec来执行需要访问swt类的线程。
swt的线程使用不如在 swing中那么方便
解决了马上给分!
他们的区别通过看单词的意思就可以知道。
如果不了解同步和异步是什么意思,
用文字解释就有点麻烦,
timerExec(int milliseconds, Runnable runnable)
Causes the run() method of the runnable to be invoked by the user-interface thread after the specified number of milliseconds have elapsed.
timerexec相当于启动一个定时创建并执行线程的定时器,上面一句是帮助文件中的,
看看帮助就什么都明白了。