﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-享受编程，融入其中，了解本质-文章分类-Swing</title><link>http://www.blogjava.net/alter/category/51763.html</link><description>美满 激情 醇厚</description><language>zh-cn</language><lastBuildDate>Wed, 23 May 2012 02:16:12 GMT</lastBuildDate><pubDate>Wed, 23 May 2012 02:16:12 GMT</pubDate><ttl>60</ttl><item><title>swing - 零零碎碎的记录</title><link>http://www.blogjava.net/alter/articles/378679.html</link><dc:creator>a_alter</dc:creator><author>a_alter</author><pubDate>Wed, 23 May 2012 01:29:00 GMT</pubDate><guid>http://www.blogjava.net/alter/articles/378679.html</guid><wfw:comment>http://www.blogjava.net/alter/comments/378679.html</wfw:comment><comments>http://www.blogjava.net/alter/articles/378679.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/alter/comments/commentRss/378679.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/alter/services/trackbacks/378679.html</trackback:ping><description><![CDATA[<div><h2></h2></div><span style="font-size: 12pt;">package javax.swing</span><br /><span style="font-size: 12pt;">1. ToolTipManager</span><br /><span style="font-size: 12pt;">2. UIManager</span><br /><span style="font-size: 12pt;">3. UIDefaults</span><span style="color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: #ffffff; font-size: 12pt; display: inline ! important; float: none;">&nbsp; -- Swing 组件的默认值表。应用程序可以通过&nbsp;</span><code style="color: #000000; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #ffffff; "><span style="font-size: 12pt;">UIManager</span></code><span style="color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: #ffffff; font-size: 12pt; display: inline ! important; float: none;">&nbsp;设置/获取默认值。</span><span style="font-size: 12pt;">(</span><span style="color: #99cc00; font-size: 12pt;">继承自hashTable -- 组件配置信息)</span> <br /><span style="font-size: 12pt;">4. LookAndFeel</span><code style="color: #000000; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #ffffff; "><span style="font-size: 12pt;"> -- LookAndFeel</span></code><span style="color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: #ffffff; font-size: medium; display: inline ! important; float: none;"><code> </code></span><span style="color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: #ffffff; font-size: 12pt; display: inline ! important; float: none;">封装了一个外观。</span><br /><span style="font-size: 12pt;">5. java.awt.SplashScreen&nbsp; -- 加载动画页面</span><span style="color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: #ffffff; font-size: 12pt; display: inline ! important; float: none;"> (1.6)<br /></span><hr size="2" width="100%" /><span style="color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: #ffffff; font-size: medium; display: inline ! important; float: none;"><div><span style="color: #ff6600; font-size: 12pt;">直接对GUI组件编写代码不是一个好的想法， swing有他自己的专用线程来接收UI事件并更新屏幕， 如果你从其他线程中做对于屏幕的操作， 那么有可能产生冲突和死锁。</span><br /> <span style="color: #ff6600; font-size: 12pt;">使用swing事件分发线程提交要执行的任务，&nbsp; 可以通过任务提交给SwingUtilities.invokeLater 来实现这种方式。 <br /> </span><span style="font-size: 12pt;">这个方法会通过事件分发线程将任务放置到执行事件队列中 --- (</span><span style="color: #99cc00; font-size: 12pt;">这个应该就是技术中通常使用的事件管理)<br /></span><span style="font-size: 12pt;">一切有关于GUI的操作全部放入该执行器中管理执行才能保证不会发生问题</span><span style="color: #99cc00;"><br /></span> <hr size="2" width="100%" /></div><br /></span><img src ="http://www.blogjava.net/alter/aggbug/378679.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/alter/" target="_blank">a_alter</a> 2012-05-23 09:29 <a href="http://www.blogjava.net/alter/articles/378679.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>