<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>权记 &#187; 插件</title>
	<atom:link href="http://www.quanlei.com/tag/%e6%8f%92%e4%bb%b6/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.quanlei.com</link>
	<description>一个关于我们生活点滴的网站，一个记录我们酸甜苦辣的日志。</description>
	<lastBuildDate>Thu, 02 Feb 2012 06:37:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>分享：serialVersionUID for NetBeans 7.0.1</title>
		<link>http://www.quanlei.com/2011/08/share-serialversionuid-for-netbeans/</link>
		<comments>http://www.quanlei.com/2011/08/share-serialversionuid-for-netbeans/#comments</comments>
		<pubDate>Tue, 09 Aug 2011 06:33:58 +0000</pubDate>
		<dc:creator>小权</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[编程相关]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[NetBeans]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://www.quanlei.com/?p=2644</guid>
		<description><![CDATA[Netbeans 最近从7.0升级到了7.0.1，常用的serialVersionUID插件不可用，于是找官网，发现已经更新了。 地址：http://kenai.com/projects/nb-svuid-generator/downloads/directory/nbms/nb7.0.1<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">无觅猜您也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="补发：最简单的Netbeans中英文切换" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2009%2F07%2F%25E8%25A1%25A5%25E5%258F%2591%25EF%25BC%259A%25E6%259C%2580%25E7%25AE%2580%25E5%258D%2595%25E7%259A%2584netbeans%25E4%25B8%25AD%25E8%258B%25B1%25E6%2596%2587%25E5%2588%2587%25E6%258D%25A2%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2011%2F08%2Fshare-serialversionuid-for-netbeans%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">补发：最简单的Netbeans中英文切换</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[转载]中文系统下使用NetBeans英文界面的方法及启动参数详解" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2008%2F10%2F%25E8%25BD%25AC%25E8%25BD%25BD%25E4%25B8%25AD%25E6%2596%2587%25E7%25B3%25BB%25E7%25BB%259F%25E4%25B8%258B%25E4%25BD%25BF%25E7%2594%25A8netbeans%25E8%258B%25B1%25E6%2596%2587%25E7%2595%258C%25E9%259D%25A2%25E7%259A%2584%25E6%2596%25B9%25E6%25B3%2595%25E5%258F%258A%25E5%2590%25AF%25E5%258A%25A8%25E5%258F%2582%25E6%2595%25B0%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2011%2F08%2Fshare-serialversionuid-for-netbeans%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2259306.jpg" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[转载]中文系统下使用NetBeans英文界面的方法及启动参数详解</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="NetBeans build-impl 文件中 iftldtodir 的解释" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F10%2Fnetbeans-build-impl-%25E6%2596%2587%25E4%25BB%25B6%25E4%25B8%25AD-iftldtodir-%25E7%259A%2584%25E8%25A7%25A3%25E9%2587%258A%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2011%2F08%2Fshare-serialversionuid-for-netbeans%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">NetBeans build-impl 文件中 iftldtodir 的解释</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="JavaFX 在netbeans 6.5上暂时不支持" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2008%2F11%2Fjavafx-%25E5%259C%25A8netbeans-65%25E4%25B8%258A%25E6%259A%2582%25E6%2597%25B6%25E4%25B8%258D%25E6%2594%25AF%25E6%258C%2581%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2011%2F08%2Fshare-serialversionuid-for-netbeans%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">JavaFX 在netbeans 6.5上暂时不支持</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[09/49周主题] – Swing Tips" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2009%2F12%2F0949-week-subject-swing%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2011%2F08%2Fshare-serialversionuid-for-netbeans%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[09/49周主题] – Swing Tips</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>Netbeans 最近从7.0升级到了7.0.1，常用的serialVersionUID插件不可用，于是找官网，发现已经更新了。</p>
<p>地址：<a href="http://kenai.com/projects/nb-svuid-generator/downloads/directory/nbms/nb7.0.1" tartget='_blank'>http://kenai.com/projects/nb-svuid-generator/downloads/directory/nbms/nb7.0.1</a></p>
<p><a href="http://www.quanlei.com/wp-content/uploads/2011/08/nb-serialVersionUID.png" rel="lightbox[2644]"><img src="http://www.quanlei.com/wp-content/uploads/2011/08/nb-serialVersionUID.png" alt="" title="nb-serialVersionUID" width="353" height="132" class="aligncenter size-full wp-image-2645" /></a></p>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.quanlei.com%2F2011%2F08%2Fshare-serialversionuid-for-netbeans%2F&title=%E5%88%86%E4%BA%AB%EF%BC%9AserialVersionUID+for+NetBeans+7.0.1" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">无觅猜您也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="补发：最简单的Netbeans中英文切换" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2009%2F07%2F%25E8%25A1%25A5%25E5%258F%2591%25EF%25BC%259A%25E6%259C%2580%25E7%25AE%2580%25E5%258D%2595%25E7%259A%2584netbeans%25E4%25B8%25AD%25E8%258B%25B1%25E6%2596%2587%25E5%2588%2587%25E6%258D%25A2%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2011%2F08%2Fshare-serialversionuid-for-netbeans%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">补发：最简单的Netbeans中英文切换</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[转载]中文系统下使用NetBeans英文界面的方法及启动参数详解" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2008%2F10%2F%25E8%25BD%25AC%25E8%25BD%25BD%25E4%25B8%25AD%25E6%2596%2587%25E7%25B3%25BB%25E7%25BB%259F%25E4%25B8%258B%25E4%25BD%25BF%25E7%2594%25A8netbeans%25E8%258B%25B1%25E6%2596%2587%25E7%2595%258C%25E9%259D%25A2%25E7%259A%2584%25E6%2596%25B9%25E6%25B3%2595%25E5%258F%258A%25E5%2590%25AF%25E5%258A%25A8%25E5%258F%2582%25E6%2595%25B0%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2011%2F08%2Fshare-serialversionuid-for-netbeans%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2259306.jpg" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[转载]中文系统下使用NetBeans英文界面的方法及启动参数详解</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="NetBeans build-impl 文件中 iftldtodir 的解释" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F10%2Fnetbeans-build-impl-%25E6%2596%2587%25E4%25BB%25B6%25E4%25B8%25AD-iftldtodir-%25E7%259A%2584%25E8%25A7%25A3%25E9%2587%258A%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2011%2F08%2Fshare-serialversionuid-for-netbeans%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">NetBeans build-impl 文件中 iftldtodir 的解释</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="JavaFX 在netbeans 6.5上暂时不支持" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2008%2F11%2Fjavafx-%25E5%259C%25A8netbeans-65%25E4%25B8%258A%25E6%259A%2582%25E6%2597%25B6%25E4%25B8%258D%25E6%2594%25AF%25E6%258C%2581%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2011%2F08%2Fshare-serialversionuid-for-netbeans%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">JavaFX 在netbeans 6.5上暂时不支持</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[09/49周主题] – Swing Tips" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2009%2F12%2F0949-week-subject-swing%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2011%2F08%2Fshare-serialversionuid-for-netbeans%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[09/49周主题] – Swing Tips</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.quanlei.com/2011/08/share-serialversionuid-for-netbeans/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>自学自用Greasemonkey</title>
		<link>http://www.quanlei.com/2010/10/%e8%87%aa%e5%ad%a6%e8%87%aa%e7%94%a8greasemonkey/</link>
		<comments>http://www.quanlei.com/2010/10/%e8%87%aa%e5%ad%a6%e8%87%aa%e7%94%a8greasemonkey/#comments</comments>
		<pubDate>Wed, 13 Oct 2010 07:46:05 +0000</pubDate>
		<dc:creator>小权</dc:creator>
				<category><![CDATA[前端开发]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://www.quanlei.com/2010/10/%e8%87%aa%e5%ad%a6%e8%87%aa%e7%94%a8greasemonkey/</guid>
		<description><![CDATA[使用Firefox的用户应该比较熟悉 Greasemonkey 这个插件吧，但是大部分估计都是使用一些网上的脚本，最近无意中突然发现 Greasemonkey 其实是非常的好用，也完全可以在自己常用的网站上自己调整使用。 比如使用 Windows Live Mail 网页版时，右侧总有讨厌的广告，以及左下角，多关闭几次，它还提醒你升级到 Plus版本，真不爽，但是这类广告firefox的广告拦截插件又不能过滤掉，那么用 Greasemonkey 就非常简单了，可以很简单的屏蔽到广告的显示，当然这中间需要用到一些HTML，javascript，dom等相关知识。例如下面简单的几句代码可以做到让右侧广告不显示： 对于完全没有概念的同学，推荐可以阅读这本书(深入浅出Greasemonkey)，在线的，内容非常简洁：http://www.firefox.net.cn/dig/ 或者参见这里：http://wiki.greasespot.net/Tutorials Enjoy yourself<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">无觅猜您也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Firefox下的另一款同步插件- Weave Sync" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F01%2Ffirefox-weave%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F10%2F%25E8%2587%25AA%25E5%25AD%25A6%25E8%2587%25AA%25E7%2594%25A8greasemonkey%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2258378.jpg" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Firefox下的另一款同步插件- Weave Sync</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Ubuntu 9.04 下为Flock安装Flash插件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2009%2F05%2Fubuntu-904-%25E4%25B8%258B%25E4%25B8%25BAflock%25E5%25AE%2589%25E8%25A3%2585flash%25E6%258F%2592%25E4%25BB%25B6%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F10%2F%25E8%2587%25AA%25E5%25AD%25A6%25E8%2587%25AA%25E7%2594%25A8greasemonkey%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Ubuntu 9.04 下为Flock安装Flash插件</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[10/08周主题] – JQuery分页导航条插件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F03%2F1008-week-subject-%25E2%2580%2593-page-navigator%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F10%2F%25E8%2587%25AA%25E5%25AD%25A6%25E8%2587%25AA%25E7%2594%25A8greasemonkey%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2258466.png" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[10/08周主题] – JQuery分页导航条插件</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[10/22 周主题] – 强悍的JQuery Validate 插件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F06%2F1022-week-subject-jquery-validate-plugin%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F10%2F%25E8%2587%25AA%25E5%25AD%25A6%25E8%2587%25AA%25E7%2594%25A8greasemonkey%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[10/22 周主题] – 强悍的JQuery Validate 插件</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Install Java Plugin To Linux FireFox" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2009%2F11%2Finstall-java-plugin-to-linux-firefox%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F10%2F%25E8%2587%25AA%25E5%25AD%25A6%25E8%2587%25AA%25E7%2594%25A8greasemonkey%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Install Java Plugin To Linux FireFox</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>使用Firefox的用户应该比较熟悉 Greasemonkey 这个插件吧，但是大部分估计都是使用一些网上的脚本，最近无意中突然发现 Greasemonkey 其实是非常的好用，也完全可以在自己常用的网站上自己调整使用。</p>
<p>比如使用 Windows Live Mail 网页版时，右侧总有讨厌的广告，以及左下角，多关闭几次，它还提醒你升级到 Plus版本，真不爽，但是这类广告firefox的广告拦截插件又不能过滤掉，那么用 Greasemonkey 就非常简单了，可以很简单的屏蔽到广告的显示，当然这中间需要用到一些HTML，javascript，dom等相关知识。例如下面简单的几句代码可以做到让右侧广告不显示：</p>
<pre class="brush: plain; title: ; notranslate">
var ad = document.getElementById('MainContent');
if(ad){
    ad.style.right='0px';
}
</pre>
<p>对于完全没有概念的同学，推荐可以阅读这本书(<strong>深入浅出Greasemonkey</strong>)，在线的，内容非常简洁：<a title="http://www.firefox.net.cn/dig/" href="http://www.firefox.net.cn/dig/">http://www.firefox.net.cn/dig/</a></p>
<p>或者参见这里：<a href="http://wiki.greasespot.net/Tutorials">http://wiki.greasespot.net/Tutorials</a></p>
<p>Enjoy yourself</p>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F10%2F%25e8%2587%25aa%25e5%25ad%25a6%25e8%2587%25aa%25e7%2594%25a8greasemonkey%2F&title=%E8%87%AA%E5%AD%A6%E8%87%AA%E7%94%A8Greasemonkey" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">无觅猜您也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Firefox下的另一款同步插件- Weave Sync" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F01%2Ffirefox-weave%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F10%2F%25E8%2587%25AA%25E5%25AD%25A6%25E8%2587%25AA%25E7%2594%25A8greasemonkey%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2258378.jpg" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Firefox下的另一款同步插件- Weave Sync</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Ubuntu 9.04 下为Flock安装Flash插件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2009%2F05%2Fubuntu-904-%25E4%25B8%258B%25E4%25B8%25BAflock%25E5%25AE%2589%25E8%25A3%2585flash%25E6%258F%2592%25E4%25BB%25B6%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F10%2F%25E8%2587%25AA%25E5%25AD%25A6%25E8%2587%25AA%25E7%2594%25A8greasemonkey%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Ubuntu 9.04 下为Flock安装Flash插件</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[10/08周主题] – JQuery分页导航条插件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F03%2F1008-week-subject-%25E2%2580%2593-page-navigator%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F10%2F%25E8%2587%25AA%25E5%25AD%25A6%25E8%2587%25AA%25E7%2594%25A8greasemonkey%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2258466.png" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[10/08周主题] – JQuery分页导航条插件</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[10/22 周主题] – 强悍的JQuery Validate 插件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F06%2F1022-week-subject-jquery-validate-plugin%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F10%2F%25E8%2587%25AA%25E5%25AD%25A6%25E8%2587%25AA%25E7%2594%25A8greasemonkey%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[10/22 周主题] – 强悍的JQuery Validate 插件</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Install Java Plugin To Linux FireFox" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2009%2F11%2Finstall-java-plugin-to-linux-firefox%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F10%2F%25E8%2587%25AA%25E5%25AD%25A6%25E8%2587%25AA%25E7%2594%25A8greasemonkey%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Install Java Plugin To Linux FireFox</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.quanlei.com/2010/10/%e8%87%aa%e5%ad%a6%e8%87%aa%e7%94%a8greasemonkey/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[10/22 周主题] – 强悍的JQuery Validate 插件</title>
		<link>http://www.quanlei.com/2010/06/1022-week-subject-jquery-validate-plugin/</link>
		<comments>http://www.quanlei.com/2010/06/1022-week-subject-jquery-validate-plugin/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 01:10:00 +0000</pubDate>
		<dc:creator>小权</dc:creator>
				<category><![CDATA[前端开发]]></category>
		<category><![CDATA[周主题]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Validate]]></category>
		<category><![CDATA[插件]]></category>
		<category><![CDATA[验证]]></category>

		<guid isPermaLink="false">http://www.quanlei.com/?p=1630</guid>
		<description><![CDATA[对于JQuery Validate，只有相见恨晚的感触，恐怕在表单验证领域这是目前我见过最好的插件了，可以很方便的使用，极大的提高表单验证的效率。 下面就介绍下简单的使用方法： 1、下载地址：http://bassistance.de/jquery-plugins/jquery-plugin-validation/，本文章发布时最新版是1.7。 2、在页面里面加载JQuery和JQuery Validate 3、写一个表单提交页面，form id 为 login，两个提交域email和password。域提供相应的id。为了完善demo，我在里面也提供了一个注册的form，同时提供了自定义验证方法和ajax提交。 4、在页面或者单独写个js文件，输入如下代码： 上面的代码基本上包含了大部分JQuery Validate的使用功能： 1、基本验证 2、自定义验证 &#8211; 自定义验证跟其他官方的验证类似，加入rules即可，message上面已经定义，可以不加。 3、页面ajax提交。 4、ajax验证Emai帐户是否可用，需要注意的是remote仅支持返回true和false，也就是checkEmail.php只能返回true和false代表Email是否可用 更多Demo，请查看JQuery Validate的官方文档，很好理解： 1、http://docs.jquery.com/Plugins/Validation 2、http://jquery.bassistance.de/validate/demo/<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">无觅猜您也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="jQuery图像剪裁插件 – Jcrop" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F01%2Fjquery-plugh-jcrop%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F06%2F1022-week-subject-jquery-validate-plugin%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2258473.png" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery图像剪裁插件 – Jcrop</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[翻译] Simple Tooltip with jQuery &amp; CSS" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F10%2Fsimple-tooltip-with-jquery-css%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F06%2F1022-week-subject-jquery-validate-plugin%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2258223.jpg" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[翻译] Simple Tooltip with jQuery &amp; CSS</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[10/08周主题] – JQuery分页导航条插件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F03%2F1008-week-subject-%25E2%2580%2593-page-navigator%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F06%2F1022-week-subject-jquery-validate-plugin%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2258466.png" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[10/08周主题] – JQuery分页导航条插件</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[09/50周主题] – JQuery入门" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2009%2F12%2F0950-week-subject-jquery%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F06%2F1022-week-subject-jquery-validate-plugin%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[09/50周主题] – JQuery入门</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Ubuntu 9.04 下为Flock安装Flash插件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2009%2F05%2Fubuntu-904-%25E4%25B8%258B%25E4%25B8%25BAflock%25E5%25AE%2589%25E8%25A3%2585flash%25E6%258F%2592%25E4%25BB%25B6%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F06%2F1022-week-subject-jquery-validate-plugin%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Ubuntu 9.04 下为Flock安装Flash插件</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>对于JQuery Validate，只有相见恨晚的感触，恐怕在表单验证领域这是目前我见过最好的插件了，可以很方便的使用，极大的提高表单验证的效率。</p>
<p>下面就介绍下简单的使用方法：</p>
<p>1、下载地址：<a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">http://bassistance.de/jquery-plugins/jquery-plugin-validation/</a>，本文章发布时最新版是1.7。</p>
<p>2、在页面里面加载JQuery和JQuery Validate</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot; src=&quot;theme/default/js/jquery-1.4.2.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;theme/default/js/jquery.validate.min.js&quot;&gt;&lt;/script&gt;
</pre>
<p>3、写一个表单提交页面，form id 为 login，两个提交域email和password。域提供相应的id。为了完善demo，我在里面也提供了一个注册的form，同时提供了自定义验证方法和ajax提交。</p>
<p><span id="more-1630"></span></p>
<p>4、在页面或者单独写个js文件，输入如下代码：</p>
<pre class="brush: jscript; title: ; notranslate">
$().ready(function() {
    //身份证验证
    jQuery.validator.addMethod(&quot;isIdCardNo&quot;, function(value, element) {
        return this.optional(element) || isIdCardNo(value);
    }, &quot;请正确输入您的身份证号码&quot;);
    // 电话号码验证
    jQuery.validator.addMethod(&quot;isPhone&quot;, function(value, element) {
        var tel = /^(\d{3,4}-?)?\d{7,9}$/g;
        return this.optional(element) || (tel.test(value));
    }, &quot;请正确填写您的电话号码&quot;);
    //昵称验证
    jQuery.validator.addMethod(&quot;nickName&quot;, function(value, element) {
        return this.optional(element) || /^[\u0391-\uFFE5\w]+$/.test(value);
    }, &quot;昵称只能由中文，英文字母、数字和下划线组成&quot;);
    //手机验证
    jQuery.validator.addMethod(&quot;isMobile&quot;, function(value, element) {
        var length = value.length;
        var mobile = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
        return this.optional(element) || (length == 11 &amp;&amp; mobile.test(value));
    }, &quot;请正确填写您的手机号码&quot;);
    // 邮政编码验证
    jQuery.validator.addMethod(&quot;isZipCode&quot;, function(value, element) {
        var tel = /^[0-9]{6}$/;
        return this.optional(element) || (tel.test(value));
    }, &quot;请正确填写您的邮政编码&quot;);

    $(&quot;#login&quot;).validate({
        //        submitHandler: function() {
        //            $(&quot;#error_tip&quot;).hide();
        //            $.ajax({
        //                data:$(&quot;#login&quot;).serialize(),
        //                // The url you are going to submit to
        //                url: &quot;login.action&quot;,
        //                dataType: 'json',
        //                timeout: 10000,
        //                // Sends a message to the console if it failed for testing purposes.
        //                error: function() {
        //                    $(&quot;#error_tip&quot;).html(&quot;&lt;span&gt;服务器忙，请稍后重试。&lt;/span&gt;&quot;)
        //                },
        //                // If successful you can do something here. You can change elements, update text, or  simply alert the response to first test to see if it worked.
        //                success: function(response) {
        //                        $(&quot;#error_tip&quot;).html(&quot;&lt;span&gt;&quot;+ response.result +&quot;&lt;/span&gt;&quot;)
        //                        $(&quot;#error_tip&quot;).show();
        //                }
        //            });
        //        },
        rules: {
            email: {
                required: true,
                email: true
            },
            password: {
                required: true
            }
        },
        messages: {
            password: {
                required: &quot;请输入密码&quot;
            },
            email: {
                required:&quot;请输入邮件地址&quot;,
                email:&quot;请输入有效的邮件地址&quot;
            }
        }
    });

    $(&quot;#reg&quot;).validate({
        rules: {
            email: {
                required: true,
                email: true,
                remote:&quot;checkEmail.action&quot;
            },
            password: {
                required: true,
                minlength: 6,
                maxlength:12
            },
            confirm_password: {
                required: true,
                minlength: 6,
                equalTo: &quot;#password&quot;
            },
            answer:{
                required: true
            },
            agree: &quot;required&quot;
        },
        messages: {
            password: {
                required: &quot;请输入密码&quot;,
                minlength: &quot;密码长度在6-12个字符之间&quot;,
                maxlength: &quot;密码长度在6-12个字符之间&quot;
            },
            confirm_password: {
                required: &quot;请输入密码&quot;,
                minlength: &quot;密码长度在6-12个字符之间&quot;,
                equalTo: &quot;你输入的密码不一致&quot;
            },
            email: {
                required:&quot;请输入有效的邮件地址&quot;,
                email: &quot;请输入有效的邮件地址&quot;,
                remote: &quot;邮件地址已存在&quot;
            },
            answer:&quot;请输入安全问题答案&quot;,
            agree: &quot;请接受我们的条款&quot;
        }
    });
}
</pre>
<p>上面的代码基本上包含了大部分JQuery Validate的使用功能：</p>
<blockquote><p>1、基本验证</p>
<p>2、自定义验证 &#8211; 自定义验证跟其他官方的验证类似，加入rules即可，message上面已经定义，可以不加。</p>
<p>3、页面ajax提交。</p>
<p>4、ajax验证Emai帐户是否可用，需要注意的是remote仅支持返回true和false，也就是checkEmail.php只能返回true和false代表Email是否可用
</p></blockquote>
<p>更多Demo，请查看JQuery Validate的官方文档，很好理解：<br />
1、<a href="http://docs.jquery.com/Plugins/Validation">http://docs.jquery.com/Plugins/Validation</a><br />
2、<a href="http://jquery.bassistance.de/validate/demo/">http://jquery.bassistance.de/validate/demo/</a></p>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F06%2F1022-week-subject-jquery-validate-plugin%2F&title=%5B10%2F22+%E5%91%A8%E4%B8%BB%E9%A2%98%5D+%E2%80%93+%E5%BC%BA%E6%82%8D%E7%9A%84JQuery+Validate+%E6%8F%92%E4%BB%B6" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">无觅猜您也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="jQuery图像剪裁插件 – Jcrop" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F01%2Fjquery-plugh-jcrop%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F06%2F1022-week-subject-jquery-validate-plugin%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2258473.png" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery图像剪裁插件 – Jcrop</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[翻译] Simple Tooltip with jQuery &amp; CSS" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F10%2Fsimple-tooltip-with-jquery-css%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F06%2F1022-week-subject-jquery-validate-plugin%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2258223.jpg" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[翻译] Simple Tooltip with jQuery &amp; CSS</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[10/08周主题] – JQuery分页导航条插件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F03%2F1008-week-subject-%25E2%2580%2593-page-navigator%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F06%2F1022-week-subject-jquery-validate-plugin%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2258466.png" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[10/08周主题] – JQuery分页导航条插件</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[09/50周主题] – JQuery入门" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2009%2F12%2F0950-week-subject-jquery%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F06%2F1022-week-subject-jquery-validate-plugin%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[09/50周主题] – JQuery入门</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Ubuntu 9.04 下为Flock安装Flash插件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2009%2F05%2Fubuntu-904-%25E4%25B8%258B%25E4%25B8%25BAflock%25E5%25AE%2589%25E8%25A3%2585flash%25E6%258F%2592%25E4%25BB%25B6%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F06%2F1022-week-subject-jquery-validate-plugin%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Ubuntu 9.04 下为Flock安装Flash插件</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.quanlei.com/2010/06/1022-week-subject-jquery-validate-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[10/08周主题] – JQuery分页导航条插件</title>
		<link>http://www.quanlei.com/2010/03/1008-week-subject-%e2%80%93-page-navigator/</link>
		<comments>http://www.quanlei.com/2010/03/1008-week-subject-%e2%80%93-page-navigator/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 07:48:14 +0000</pubDate>
		<dc:creator>小权</dc:creator>
				<category><![CDATA[前端开发]]></category>
		<category><![CDATA[周主题]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[分页导航]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://www.quanlei.com/?p=1270</guid>
		<description><![CDATA[之前在写 [10/02周主题] – 仿Gmail头像上传剪辑 时说，还有个JQuery的分页组件分享给大家，这个组件是别人设计的，我只是在其基础上，进行一些改动，以符合自身项目的需求。 之前在做Web项目时，分页功能的处理是放在服务器端，客户端只是用来显示分页导航条内容。 虽然将服务器端的分页功能进行封装，页码显示代码也进行了整理，但是总归不是很方便，做分页功能还是要做不少工作。 后来去看一些将分页功能放在客户端处理的例子，最后发现了这个比较不错的JQuery组件（如果你有好的方案也欢迎分享啊），原文章在这里：http://lym6520.javaeye.com/blog/540580，我就不做过多介绍了。 通过这个组件做分页功能，服务器端几乎不做什么处理，只需要显示数据列表时把总数传给该组件即可。至于分页组件的样式你完全可以自己去定制。 下面分享下自己的一些优化工作： 1、Loading和错误提示 Loading和错误信息的显示在获取数据时控制，这里用到了Ajax的几个状态来判断，比如beforeSend，success以及error。 2、分页组件的翻页和获取数据是异步的，这样如果出现服务器问题，无法获取翻页后的信息，但是分页导航条已经做了翻页了。由于服务器出错是在Ajax里面捕获的，这样就只能做个hack，通过dom操作来让翻页返回去，最终的效果会是这样的：假如现在在第三页，要跳转到第四页，点 “4” 翻页了，然后发现翻页后无法获取数据，出现服务器问题了，接着就又返回第三页了，显示错误信息。<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">无觅猜您也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="jQuery图像剪裁插件 – Jcrop" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F01%2Fjquery-plugh-jcrop%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F03%2F1008-week-subject-%25E2%2580%2593-page-navigator%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2258473.png" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery图像剪裁插件 – Jcrop</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[10/22 周主题] – 强悍的JQuery Validate 插件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F06%2F1022-week-subject-jquery-validate-plugin%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F03%2F1008-week-subject-%25E2%2580%2593-page-navigator%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[10/22 周主题] – 强悍的JQuery Validate 插件</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[翻译] Simple Tooltip with jQuery &amp; CSS" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F10%2Fsimple-tooltip-with-jquery-css%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F03%2F1008-week-subject-%25E2%2580%2593-page-navigator%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2258223.jpg" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[翻译] Simple Tooltip with jQuery &amp; CSS</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[09/50周主题] – JQuery入门" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2009%2F12%2F0950-week-subject-jquery%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F03%2F1008-week-subject-%25E2%2580%2593-page-navigator%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[09/50周主题] – JQuery入门</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[10/02周主题] – 仿Gmail头像上传剪辑" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F01%2F1002-week-subject-gmail-icon-cutter%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F03%2F1008-week-subject-%25E2%2580%2593-page-navigator%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2258471.png" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[10/02周主题] – 仿Gmail头像上传剪辑</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>之前在写 <a title="Permanent Link to [10/02周主题] – 仿Gmail头像上传剪辑" rel="bookmark" href="../2010/01/1002-week-subject-gmail-icon-cutter/">[10/02周主题] – 仿Gmail头像上传剪辑</a> 时说，还有个JQuery的分页组件分享给大家，这个组件是别人设计的，我只是在其基础上，进行一些改动，以符合自身项目的需求。</p>
<p>之前在做Web项目时，分页功能的处理是放在服务器端，客户端只是用来显示分页导航条内容。 虽然将服务器端的分页功能进行封装，页码显示代码也进行了整理，但是总归不是很方便，做分页功能还是要做不少工作。</p>
<p>后来去看一些将分页功能放在客户端处理的例子，最后发现了这个比较不错的JQuery组件（如果你有好的方案也欢迎分享啊），原文章在这里：http://lym6520.javaeye.com/blog/540580，我就不做过多介绍了。</p>
<p>通过这个组件做分页功能，服务器端几乎不做什么处理，只需要显示数据列表时把总数传给该组件即可。至于分页组件的样式你完全可以自己去定制。</p>
<p>下面分享下自己的一些优化工作：</p>
<p>1、Loading和错误提示</p>
<p><a href="http://www.quanlei.com/wp-content/uploads/2010/03/page-loading.png" rel="lightbox[1270]"><img class="size-full wp-image-1272 alignnone" title="page-loading" src="http://www.quanlei.com/wp-content/uploads/2010/03/page-loading.png" alt="" width="485" height="53" /></a></p>
<p><a href="http://www.quanlei.com/wp-content/uploads/2010/03/page-error.png" rel="lightbox[1270]"><img class="size-full wp-image-1273 alignnone" title="page-error" src="http://www.quanlei.com/wp-content/uploads/2010/03/page-error.png" alt="" width="565" height="44" /></a></p>
<p>Loading和错误信息的显示在获取数据时控制，这里用到了Ajax的几个状态来判断，比如beforeSend，success以及error。</p>
<p>2、分页组件的翻页和获取数据是异步的，这样如果出现服务器问题，无法获取翻页后的信息，但是分页导航条已经做了翻页了。由于服务器出错是在Ajax里面捕获的，这样就只能做个hack，通过dom操作来让翻页返回去，最终的效果会是这样的：假如现在在第三页，要跳转到第四页，点 “4” 翻页了，然后发现翻页后无法获取数据，出现服务器问题了，接着就又返回第三页了，显示错误信息。</p>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F03%2F1008-week-subject-%25e2%2580%2593-page-navigator%2F&title=%5B10%2F08%E5%91%A8%E4%B8%BB%E9%A2%98%5D+%E2%80%93+JQuery%E5%88%86%E9%A1%B5%E5%AF%BC%E8%88%AA%E6%9D%A1%E6%8F%92%E4%BB%B6" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">无觅猜您也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="jQuery图像剪裁插件 – Jcrop" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F01%2Fjquery-plugh-jcrop%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F03%2F1008-week-subject-%25E2%2580%2593-page-navigator%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2258473.png" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">jQuery图像剪裁插件 – Jcrop</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[10/22 周主题] – 强悍的JQuery Validate 插件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F06%2F1022-week-subject-jquery-validate-plugin%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F03%2F1008-week-subject-%25E2%2580%2593-page-navigator%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[10/22 周主题] – 强悍的JQuery Validate 插件</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[翻译] Simple Tooltip with jQuery &amp; CSS" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F10%2Fsimple-tooltip-with-jquery-css%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F03%2F1008-week-subject-%25E2%2580%2593-page-navigator%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2258223.jpg" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[翻译] Simple Tooltip with jQuery &amp; CSS</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[09/50周主题] – JQuery入门" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2009%2F12%2F0950-week-subject-jquery%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F03%2F1008-week-subject-%25E2%2580%2593-page-navigator%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[09/50周主题] – JQuery入门</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[10/02周主题] – 仿Gmail头像上传剪辑" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F01%2F1002-week-subject-gmail-icon-cutter%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2010%2F03%2F1008-week-subject-%25E2%2580%2593-page-navigator%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2258471.png" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[10/02周主题] – 仿Gmail头像上传剪辑</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.quanlei.com/2010/03/1008-week-subject-%e2%80%93-page-navigator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[09/49周主题] – Swing Tips</title>
		<link>http://www.quanlei.com/2009/12/0949-week-subject-swing/</link>
		<comments>http://www.quanlei.com/2009/12/0949-week-subject-swing/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 12:35:17 +0000</pubDate>
		<dc:creator>小权</dc:creator>
				<category><![CDATA[周主题]]></category>
		<category><![CDATA[编程相关]]></category>
		<category><![CDATA[AWT]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[NetBeans]]></category>
		<category><![CDATA[Swing]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[客户]]></category>
		<category><![CDATA[插件]]></category>
		<category><![CDATA[界面]]></category>
		<category><![CDATA[设计]]></category>

		<guid isPermaLink="false">http://www.quanlei.com/?p=974</guid>
		<description><![CDATA[选择这个主题，是因为上周公司刚好做了一个有关“Beginning Java AWT and Swing” 的培训，借此机会正好总结一下这方面的使用技巧。对于Swing界面方面的研究，我仅仅是应用而已，公司里有几位同事在这方面的研究比较深，这块的应用和使用技巧分两部分， 一部分是Swing 使用本身的，另一部分是Design工具NetBeans的，如果是刚入门建议从这里看起：Creating a GUI With JFC/Swing。 本期主题：Swing Tips 一、性能问题 随着Java 6对于Swing性能的改进，Swing的运行速度已经开始得到了大大的提高，看看NetBeans就知道了，NetBeans就是Swing开发的，如果你跑Swing很慢，很耗资源，那么应该从自己的程序上找找问题，推荐使用NetBeans自带的Profile查找原因，教程在这里 &#8211; Profile Introduce 。 二、LookAndFeel 用Swing做企业应用时，LookAndFeel的选择和使用是决定这个项目能否被客户接受的一个很大因素，即要好看，又要考虑跨平台的兼容性，必要时自己还得设计部分LookAndFeel， 可以看看这里提供的一些开源LookAndFeel：http://www.open-open.com/61.htm 和http://www.javootoo.com/。 切换LookAndFeel： 三、合理的控制初始化组件和组件初始化的顺序可以很大的提高性能 举个例子：之前我们项目中有一个地方，当打开程序时，会初始化几十个甚至成百个JPanel，这显然成为程序启动时慢的一个因素，也导致了用户体验的降低，这些JPanel完全可以在程序启动后再根据用户的需要去初始化，因为用户打开程序时这些Panel不是必须看到的。 四、要有统一的UI规范 比如Button的高度，进度条的高宽等，也可以通过UIManager给系统组件设置统一属性，比如统一设定Button的间距和字体： 五、多线程的使用 用Swing做的都是界面的东西，如果界面假死或者用户等待事件太长，那么用户体验必然是不好的，这里就需要用到多线程的使用了，当界面处理一个请求时，不能让界面假死了，需要后台另一个线程去做处理，然后将结果返回到Swing线程，这块可以看看SwingWorker的介绍。 六、布局管理器 布局管理器的使用在Swing里面是比较重要的，它直接决定了你界面的显示效果，也是比较难用的一块，不好举例子，建议多了解每个布局管理器的使用场景。 七、JTable &#38; JTree 在Swing组件的使用中除了布局管理器，估计就数JTable和JTree的使用稍微有点麻烦了，下面我就分享一些实际项目中JTable的一些实例，关于JTree，可以点这里：JTree 经验 总结 。 JTable相关 1、自定义表头排序 2、自定义Table Renderer 3、自定义Table列宽 4、禁止Table列拖动 5、单选表格设置 6、设置表头默认支持排序 7、设置列不可随容器组件大小变化自动调整宽度 8、固定Table上的某些列不滚动 这个需求是这样的，比如Table上左边有部分数据，是后面数据所共有的属性，那么当后面数据很多时，显示不下会出现滚动条，但是滚动时又不想让左侧的共有属性动，只滚动右侧的数据部分。 实现原理是:scrollPane里面放置一个表格，然后在scrollPane的左上角放置以共有属性的部分为Model的表格，剩下的右侧就是剩余的纯数据表格。 最终效果就是表格左侧的列锁定了，右侧数据出现滚动条时，可以滚动，但左侧不动。 核心代码：比如有HeaderTable和ReportTable， [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">无觅猜您也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Swing Nixieclock（原子钟）效果" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F01%2Fswing-nixieclock%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2009%2F12%2F0949-week-subject-swing%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2258436.png" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Swing Nixieclock（原子钟）效果</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="在Swing中做更多web的事情" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2011%2F09%2Fswing-web-browser%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2009%2F12%2F0949-week-subject-swing%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/09/20/32283483.png" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">在Swing中做更多web的事情</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="分享：serialVersionUID for NetBeans 7.0.1" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2011%2F08%2Fshare-serialversionuid-for-netbeans%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2009%2F12%2F0949-week-subject-swing%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/08/10/21935247.png" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">分享：serialVersionUID for NetBeans 7.0.1</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Swing Table上的常用技巧" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2009%2F07%2Fswing-table%25E4%25B8%258A%25E7%259A%2584%25E5%25B8%25B8%25E7%2594%25A8%25E6%258A%2580%25E5%25B7%25A7%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2009%2F12%2F0949-week-subject-swing%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Swing Table上的常用技巧</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Drawing in code" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F02%2Fdrawing-in-code%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2009%2F12%2F0949-week-subject-swing%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2258440.png" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Drawing in code</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><span style="color: #800000;"><span style="font-size: xx-large;">选</span></span>择这个主题，是因为上周公司刚好做了一个有关“Beginning Java AWT and Swing” 的培训，借此机会正好总结一下这方面的使用技巧。对于Swing界面方面的研究，我仅仅是应用而已，公司里有几位同事在这方面的研究比较深，这块的应用和使用技巧分两部分， 一部分是Swing 使用本身的，另一部分是Design工具NetBeans的，如果是刚入门建议从这里看起：<a href="http://java.sun.com/docs/books/tutorial/uiswing/index.html" target="_blank">Creating a GUI With JFC/Swing</a>。</p>
<h2>本期主题：Swing Tips</h2>
<h3>一、性能问题</h3>
<blockquote><p>随着Java 6对于Swing性能的改进，Swing的运行速度已经开始得到了大大的提高，看看NetBeans就知道了，NetBeans就是Swing开发的，如果你跑Swing很慢，很耗资源，那么应该从自己的程序上找找问题，推荐使用NetBeans自带的Profile查找原因，教程在这里 &#8211; <a href="http://zh-cn.netbeans.org/kb/60/java/profiler-intro.html" target="_blank">Profile Introduce</a> 。</p></blockquote>
<h3>二、LookAndFeel</h3>
<blockquote><p>用Swing做企业应用时，LookAndFeel的选择和使用是决定这个项目能否被客户接受的一个很大因素，即要好看，又要考虑跨平台的兼容性，必要时自己还得设计部分LookAndFeel， 可以看看这里提供的一些开源LookAndFeel：http://www.open-open.com/61.htm 和http://www.javootoo.com/。<br />
切换LookAndFeel：</p>
<pre class="brush: java; title: ; notranslate">
UIManager.setLookAndFeel(LookAndFeelName);
SwingUtilities.updateComponentTreeUI(frame);
frame.pack();
</pre>
</blockquote>
<h3>三、合理的控制初始化组件和组件初始化的顺序可以很大的提高性能</h3>
<blockquote><p>举个例子：之前我们项目中有一个地方，当打开程序时，会初始化几十个甚至成百个JPanel，这显然成为程序启动时慢的一个因素，也导致了用户体验的降低，这些JPanel完全可以在程序启动后再根据用户的需要去初始化，因为用户打开程序时这些Panel不是必须看到的。</p></blockquote>
<h3>四、要有统一的UI规范</h3>
<blockquote><p>比如Button的高度，进度条的高宽等，也可以通过UIManager给系统组件设置统一属性，比如统一设定Button的间距和字体：</p>
<pre class="brush: java; title: ; notranslate">
UIManager.put(&quot;Button.margin&quot;, new Insets(2, 5, 2, 5));
UIManager.put(&quot;Button.font&quot;, new Font(&quot;宋体&quot;, Font.PLAIN, 13));
</pre>
</blockquote>
<h3>五、多线程的使用</h3>
<blockquote><p>用Swing做的都是界面的东西，如果界面假死或者用户等待事件太长，那么用户体验必然是不好的，这里就需要用到多线程的使用了，当界面处理一个请求时，不能让界面假死了，需要后台另一个线程去做处理，然后将结果返回到Swing线程，这块可以看看<a href="http://java.sun.com/javase/6/docs/api/javax/swing/SwingWorker.html" target="_blank">SwingWorker</a>的介绍。</p></blockquote>
<h3>六、布局管理器</h3>
<blockquote><p>布局管理器的使用在Swing里面是比较重要的，它直接决定了你界面的显示效果，也是比较难用的一块，不好举例子，建议多了解每个布局管理器的使用场景。</p></blockquote>
<h3>七、JTable &amp; JTree</h3>
<blockquote><p>在Swing组件的使用中除了布局管理器，估计就数JTable和JTree的使用稍微有点麻烦了，下面我就分享一些实际项目中JTable的一些实例，关于JTree，可以点这里：<a href="http://www.google.cn/search?hl=zh-CN&amp;newwindow=1&amp;q=JTree+%E7%BB%8F%E9%AA%8C+%E6%80%BB%E7%BB%93" target="_blank">JTree 经验 总结</a> 。</p>
<h4>JTable相关</h4>
<h5>1、自定义表头排序</h5>
<pre class="brush: java; title: ; notranslate">
TableRowSorter rs = (TableRowSorter) table.getRowSorter();
Comparator&lt;Integer&gt; intComparator = new Comparator&lt;Integer&gt;() {

            public int compare(Integer o1, Integer o2) {
                return o1.compareTo(o2);
            }
        };
rs.setComparator(3, intComparator);
 </pre>
<h5>2、自定义Table Renderer</h5>
<pre class="brush: java; title: ; notranslate">
public class CommonTableCellRenderer extends DefaultTableCellRenderer {

        @Override
        public Component getTableCellRendererComponent(JTable table, Object value,
                boolean isSelected, boolean cellHasFocus, int row, int column) {
            JComponent comp = (JComponent) super.getTableCellRendererComponent(table, value,
isSelected, cellHasFocus, row, column);
            //表格的奇数偶数行交叉颜色显示
            if (!isSelected) {
                if (row % 2 == 0) {
                    comp.setBackground(UIConsts.HIGHLIGHTER_COLOR);
                } else {
                    comp.setBackground(Color.white);
                }
            }

            //table column里面显示图标和对齐方式
            switch (column) {
                case PaperTableModel.STATUS_COLUMN:
                    switch ((EntityStatus) value) {
                        case VALID:
                            comp.setIcon(ENABLED_ICON);
                            setHorizontalAlignment(JLabel.LEADING);
                            break;
                        case DISABLED:
                            comp.setIcon(DISABLED_ICON);
                            setHorizontalAlignment(JLabel.CENTER);
                            break;
                    }
                    break;
                default:
                    comp.setIcon(null);
                    break;
            }

            return comp;
        }
    }
 </pre>
<h5>3、自定义Table列宽</h5>
<pre class="brush: java; title: ; notranslate">
TableColumnModel colModel = table.getColumnModel();
colModel.getColumn(0).setPreferredWidth(70);
colModel.getColumn(1).setPreferredWidth(55);
colModel.getColumn(2).setPreferredWidth(120);
</pre>
<h5>4、禁止Table列拖动</h5>
<pre class="brush: java; title: ; notranslate"> table.getTableHeader().setReorderingAllowed(false);  </pre>
<h5>5、单选表格设置</h5>
<pre class="brush: java; title: ; notranslate"> table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);   </pre>
<h5>6、设置表头默认支持排序</h5>
<pre class="brush: java; title: ; notranslate"> table.setAutoCreateRowSorter(true);  </pre>
<h5>7、设置列不可随容器组件大小变化自动调整宽度</h5>
<pre class="brush: java; title: ; notranslate"> table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);  </pre>
<h5>8、固定Table上的某些列不滚动</h5>
<p>这个需求是这样的，比如Table上左边有部分数据，是后面数据所共有的属性，那么当后面数据很多时，显示不下会出现滚动条，但是滚动时又不想让左侧的共有属性动，只滚动右侧的数据部分。<br />
实现原理是:scrollPane里面放置一个表格，然后在scrollPane的左上角放置以共有属性的部分为Model的表格，剩下的右侧就是剩余的纯数据表格。<br />
最终效果就是表格左侧的列锁定了，右侧数据出现滚动条时，可以滚动，但左侧不动。<br />
核心代码：比如有HeaderTable和ReportTable， 其中ReportTable是放置在一个ScrollPanel里面，Model是所有数据的Model，将左侧的数据和右侧的数据分开</p>
<pre class="brush: java; title: ; notranslate">
//找到主表所在的scrollPane
JScrollPane scrollPane = (JScrollPane) SwingUtilities.
   getAncestorOfClass(JScrollPane.class,
    reportTable.getTable());

//中间处理headerTable的数据和reportTable剩余的数据

//将新表HeaderTable放在scrollPane的左上角
scrollPane.setRowHeaderView(headerTable.getTable());
scrollPane.setCorner(JScrollPane.UPPER_LEFT_CORNER,
                    headerTable.getTable().getTableHeader());
</pre>
<h5>9、Table上的直接编辑功能</h5>
<p>两点：<br />
1、重写 public boolean isCellEditable(int row, int columnIndex) 方法，定义可编辑的行列。<br />
2、重写 public void setValueAt(Object obj, int rowIndex, int columnIndex) 方法，拿到原来的对象，设置新的对象值。</p>
<h5>10、Table的Excel导出功能</h5>
<p>表格上的Excel导出功能还是比较实用的功能，企业应用一般都会用到，这里提供相关代码</p>
<pre class="brush: java; title: ; notranslate">
try {
   WritableCellFormat titleFormat = new WritableCellFormat(
   new WritableFont(WritableFont.createFont(&quot;黑体&quot;), 16,
   WritableFont.NO_BOLD));
   titleFormat.setVerticalAlignment(VerticalAlignment.CENTRE); // 垂直对齐
   titleFormat.setAlignment(Alignment.CENTRE); // 水平对齐
   titleFormat.setWrap(true); // 是否换行

   WritableCellFormat headerFormat = new WritableCellFormat();
   headerFormat.setBorder(Border.ALL, BorderLineStyle.THIN); // 线条
   headerFormat.setVerticalAlignment(VerticalAlignment.CENTRE); // 垂直对齐
   headerFormat.setAlignment(Alignment.CENTRE); // 水平对齐
   headerFormat.setWrap(true); // 是否换行

   WritableCellFormat countFormat = new WritableCellFormat(
   new NumberFormat(&quot;0.000&quot;));
   countFormat.setBorder(Border.ALL, BorderLineStyle.THIN); // 线条
   countFormat.setVerticalAlignment(VerticalAlignment.CENTRE); // 垂直对齐
   countFormat.setAlignment(Alignment.RIGHT); // 水平对齐
   countFormat.setWrap(true); // 是否换行

   WritableCellFormat moneyFormat = new WritableCellFormat(
   new NumberFormat(&quot;0.00&quot;));
   moneyFormat.setBorder(Border.ALL, BorderLineStyle.THIN); // 线条
   moneyFormat.setVerticalAlignment(VerticalAlignment.CENTRE); // 垂直对齐
   moneyFormat.setAlignment(Alignment.RIGHT); // 水平对齐
   moneyFormat.setWrap(true); // 是否换行

   WritableCellFormat intFormat = new WritableCellFormat(
   new NumberFormat(&quot;0&quot;));
   intFormat.setBorder(Border.ALL, BorderLineStyle.THIN); // 线条
   intFormat.setVerticalAlignment(VerticalAlignment.CENTRE); // 垂直对齐
   intFormat.setAlignment(Alignment.RIGHT); // 水平对齐
   intFormat.setWrap(true); // 是否换行

   WritableWorkbook book = Workbook.createWorkbook(exportFile);
   WritableSheet sheet = book.createSheet(&quot;综合统计报表&quot;, 0);
   int titleRow = 0;
   int headerRow = 3;
   int dataRow = 5;
   sheet.mergeCells(0, titleRow, model.getColumnCount() - 1,
   titleRow);
   Label titleLab = new Label(0, titleRow, tableTitleTxfd.getText(), titleFormat);
   sheet.addCell(titleLab);

   //生成表头
   for (int j = 0; j &lt; model.getColumnCount(); j++) {
       sheet.mergeCells(j, headerRow, j, headerRow + 1);
       Label lab = new Label(j, headerRow, model.getColumnName(
      j), headerFormat);
       sheet.addCell(lab);
   }

   for (int row = 0; row &lt; model.getRowCount(); row++) {
       for (int col = 0; col &lt; model.getColumnCount(); col++) {
          Object obj = model.getValueAt(row, col);
          if (obj instanceof String) {
             Label lab = new Label(col, dataRow + row,
               (String) obj, headerFormat);
            sheet.addCell(lab);
          } else if (obj instanceof Integer) {
         Number labelN = new Number(col, dataRow
         + row, (Integer) obj, intFormat);
         sheet.addCell(labelN);
         } else {
         Label lab =
         new Label(col, dataRow + row, &quot;&quot;,
         headerFormat);
         sheet.addCell(lab);
         }
      }
   }

   //生成表尾
   int footerRow = dataRow + model.getRowCount() + 1;
   int step =
   (int) (((double) (model.getColumnCount() - 2) / 3)
   + 1);
   Label footerLab = new Label(0, footerRow, &quot;部门负责人：&quot;);
   sheet.addCell(footerLab);
   footerLab = new Label(step, footerRow, &quot;制表：&quot; + creatorTxfd.getText());
   sheet.addCell(footerLab);
   footerLab = new Label(model.getColumnCount() - 2, footerRow,
   NazcaFormater.getSimpleDateString(new Date()));
   sheet.addCell(footerLab);

   sheet.setColumnView(0, 16);
   sheet.setRowView(titleRow, 600);

   book.write();
   book.close();
   //导出成功
   } catch (Throwable ex) {
   //导出报表失败
   ex.printStackTrace();
}
</pre>
<h5>11、Table的打印功能</h5>
<p>打印这块，之前已经提过，可以参考之前的文章 <a href="http://www.quanlei.com/2009/11/jtable_print/">JTable Print</a></p>
<h5>12、在Table上选择多行</h5>
<pre class="brush: java; title: ; notranslate">
int rowcounts=table.getSelectedRows().length;
if(rowcounts&gt;1)
  int[] rows=table.getSelectedRows();
    for(int i=0;i&lt;rows.length;i++){
    String value=(String) tableModel.getValueAt(i, 1);
  }
}
</pre>
</blockquote>
<h2>NetBeans 6+ Tips</h2>
<p>这里说NetBeans，主要是因为目前Swing开发方面，还没有哪个IDE能胜过NetBeans。</p>
<blockquote><p>一、NetBeans的配置</p>
<blockquote><p>1、配置为英文，大部分时间我们下载的都是中文的版本，可以通过在/$NetBeans_HOME/etc/netbeans.conf中添加 &#8211;locale en_US， 让启动时显示为英文，这个之前也有文章介绍：<a href="http://www.quanlei.com/tag/netbeans-%E8%8B%B1%E6%96%87%E7%95%8C%E9%9D%A2/" target="_blank">Netbeans 英文界面</a> 和 <a href="http://www.quanlei.com/2009/07/%E8%A1%A5%E5%8F%91%EF%BC%9A%E6%9C%80%E7%AE%80%E5%8D%95%E7%9A%84netbeans%E4%B8%AD%E8%8B%B1%E6%96%87%E5%88%87%E6%8D%A2/" target="_blank">最简单的Netbeans中英文切换</a><br />
2、优化配置可以看之前介绍的这篇文章，就不重复了：<a href="http://www.quanlei.com/2008/12/netbeans-65-%E4%BC%98%E5%8C%96%E5%BB%BA%E8%AE%AE/" target="_blank">Netbeans 6.5 优化建议 </a></p></blockquote>
<p>二、经验分享</p>
<blockquote><p>1、Swing的Debug虽然被很多人说不好用，但是在用NetBeans时，多用Debug可以提高效率，因为Debug模式下的修改，大部分只要点击应用，就可以不用重启项目而看到效果。<br />
2、很好用的快捷键和快速补齐(限Windows + Linux下，如果在Mac下改成 ⌘ 试试)，如：</p>
<blockquote>
<pre>快捷键：
Ctrl+R          Rename
Alt+Enter       Fix Error(Eclipse Ctrl+1)
Alt+Shift+F    Quick Format
Alt+Shift+I     Fix Import
F9                Build File
F6                Run Main Project
Shift+F6        Run File
Ctrl+|           Insert Code

快速补齐（英文输入状态下，输入完后按Tab键，也可以自己配置为其他键，在Options - Editor -
Code Templates下）：
psvm            public static void main
sout             System.out.println
im               implements
Psfs             public static final String
psfi             private static final String
fore            for($ : $){}
fori             for(int i = 0; i &lt; arr.length; i++){}
forl             for(int i = 0; i &lt; list.size(); i++){}</pre>
</blockquote>
</blockquote>
<p>三、插件分享<br />
我们都知道NetBeans上的插件很多，可以说NetBeans正是因为这些插件才强大起来，支持的功能也更多了。分享的这几个插件是平时工作时，可以显著提高效率的，不好的不推荐，你如果有好的也别忘记分享下。</p>
<blockquote><p>1、Path Tools  &#8211; 可以直接查找到类或者文件夹所在的磁盘位置，基本是我每次装完NetBeans的后第一个装的插件。<br />
2、SQE(Software Quality Environment) &#8211; 是最近同事刚刚推荐的一个插件，看名字就知道了，是一个类似Firebug的插件，可以发现程序中存在的一些显著的错误，很不错。<br />
3、<a href="http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=9000" target="_blank">UUID Generator </a>- 同事写的一个快速生成UUID的插件。<br />
4、SwingX 插件 &#8211; 用来添加一些SwingX组件的。<br />
5、iReport &#8211; 打印报表用的插件，结合JasperReport使用。</p></blockquote>
</blockquote>
<p style="margin:0;padding:0;height:1px;overflow:hidden;">
    <script type="text/javascript"><!--
        var wumiiSitePrefix = "http://www.quanlei.com";
        var wumiiEnableCustomPos = false;
        var wumiiParams = "&#038;num=6&#038;mode=3&#038;displayInFeed=1&#038;version=1.0.5.5&#038;pf=WordPress3.3.1";
    //--></script><script type="text/javascript" src="http://widget.wumii.com/ext/relatedItemsWidget.htm"></script><a href="http://www.wumii.com/widget/relatedItems.htm" style="border:0;"><img src="http://static.wumii.com/images/pixel.png" alt="无觅相关文章插件，快速提升流量" style="border:0;padding:0;margin:0;" /></a></p>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.quanlei.com%2F2009%2F12%2F0949-week-subject-swing%2F&title=%5B09%2F49%E5%91%A8%E4%B8%BB%E9%A2%98%5D+%E2%80%93+Swing+Tips" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">无觅猜您也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Swing Nixieclock（原子钟）效果" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F01%2Fswing-nixieclock%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2009%2F12%2F0949-week-subject-swing%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2258436.png" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Swing Nixieclock（原子钟）效果</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="在Swing中做更多web的事情" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2011%2F09%2Fswing-web-browser%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2009%2F12%2F0949-week-subject-swing%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/09/20/32283483.png" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">在Swing中做更多web的事情</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="分享：serialVersionUID for NetBeans 7.0.1" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2011%2F08%2Fshare-serialversionuid-for-netbeans%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2009%2F12%2F0949-week-subject-swing%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/08/10/21935247.png" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">分享：serialVersionUID for NetBeans 7.0.1</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Swing Table上的常用技巧" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2009%2F07%2Fswing-table%25E4%25B8%258A%25E7%259A%2584%25E5%25B8%25B8%25E7%2594%25A8%25E6%258A%2580%25E5%25B7%25A7%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2009%2F12%2F0949-week-subject-swing%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Swing Table上的常用技巧</font>
                    </a>
                </td>
                <td width="116" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Drawing in code" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.quanlei.com%2F2010%2F02%2Fdrawing-in-code%2F&from=http%3A%2F%2Fwww.quanlei.com%2F2009%2F12%2F0949-week-subject-swing%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 110px !important; height: 110px !important;" src="http://static.wumii.com/site_images/2011/01/21/2258440.png" width="110px" height="110px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 116px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Drawing in code</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.quanlei.com/2009/12/0949-week-subject-swing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

