multithreaded control examples. A user interface thread, the thread is responsible for response workers.
基于1个网页-相关网页
AWT and Swing use this model, in which there is a GUI event thread, and all work that causes changes in the user interface must execute in that thread.
AWT和Swing就使用这个模型,在这个模型中有一个GUI事件线程,导致用户界面发生变化的所有工作都必须在该线程中执行。
The PresentationReconciler class updates the text's appearance with every keystroke, and the Reconciler class runs in a daemon thread, parsing the document without holding up the user interface (UI).
presentationreconciler类根据每次击键更新文本的外观,而Reconciler类运行一个守护线程,不必将用户界面(UI)挂起就能解析该文档。
Specifically, if everything is happening in a single thread, performing long operations such as network access or database queries on the UI thread will block the whole user interface.
特别是,如果把所有的事件都放在主线程中来处理,需要长时间来处理的事件比如网络访问或者数据库查询,会阻塞整个UI。
应用推荐