??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲免费视频中文字幕,不用播放器成人网,浮生影视网在线观看免费http://www.aygfsteel.com/ilovesimple/zh-cnTue, 24 Jun 2025 22:32:48 GMTTue, 24 Jun 2025 22:32:48 GMT60l箋Mavenhttp://www.aygfsteel.com/ilovesimple/archive/2011/10/30/362325.htmlsimplelovesimpleloveSun, 30 Oct 2011 10:56:00 GMThttp://www.aygfsteel.com/ilovesimple/archive/2011/10/30/362325.htmlhttp://www.aygfsteel.com/ilovesimple/comments/362325.htmlhttp://www.aygfsteel.com/ilovesimple/archive/2011/10/30/362325.html#Feedback0http://www.aygfsteel.com/ilovesimple/comments/commentRss/362325.htmlhttp://www.aygfsteel.com/ilovesimple/services/trackbacks/362325.html
查了半天Q终于发CQ在目dependency里依赖到的第三方的一个包里它依赖C我需要查扄包,Dq个包被貌似莫名其妙的进入到了deploy/lib下面?img src ="http://www.aygfsteel.com/ilovesimple/aggbug/362325.html" width = "1" height = "1" />

simplelove 2011-10-30 18:56 发表评论
]]>
Scrumhttp://www.aygfsteel.com/ilovesimple/archive/2010/08/18/329190.htmlsimplelovesimpleloveWed, 18 Aug 2010 02:48:00 GMThttp://www.aygfsteel.com/ilovesimple/archive/2010/08/18/329190.htmlhttp://www.aygfsteel.com/ilovesimple/comments/329190.htmlhttp://www.aygfsteel.com/ilovesimple/archive/2010/08/18/329190.html#Feedback0http://www.aygfsteel.com/ilovesimple/comments/commentRss/329190.htmlhttp://www.aygfsteel.com/ilovesimple/services/trackbacks/329190.htmlAttended Scrum training theses two days.

Some highlights from the training:

  1. Scrum master is a facilitator, does not assign task. Team owns tasks itself.
  2. Each feature has a unique rank, decided by product owner and scrum master and the team. Always finish rank high feature first, before continue rank low feature.
  3. Scrum always encourage communication and collaboration.
  4. Scrum is not a project management, but a framework for all the teams to do the things in same way. Project management methodology is still needed in Scrum.
  5. Scrum deliver value sooner than waterfall method.
  6. Scrum fits the product/project that requirements are not so fixed.
  7. Each team/person has its own customer.
  8. Successful software development projects are mainly based on people interactions.
  9. Advocate zero defect in iterations, ready to release after each iteration.
  10. XP is next level of Agile after Scrum.


simplelove 2010-08-18 10:48 发表评论
]]>
10 Tips to Increase IntelliJ IDEA Performance (?http://www.aygfsteel.com/ilovesimple/archive/2010/07/30/327516.htmlsimplelovesimpleloveThu, 29 Jul 2010 17:40:00 GMThttp://www.aygfsteel.com/ilovesimple/archive/2010/07/30/327516.htmlhttp://www.aygfsteel.com/ilovesimple/comments/327516.htmlhttp://www.aygfsteel.com/ilovesimple/archive/2010/07/30/327516.html#Feedback0http://www.aygfsteel.com/ilovesimple/comments/commentRss/327516.htmlhttp://www.aygfsteel.com/ilovesimple/services/trackbacks/327516.htmlI upgraded to IntelliJ IDEA 7.0 the day it came out and was, at first, let down by how poorly it performed on my machine. Since then, I tweaked a bunch of settings, and now have it performing just as fast as IDEA 5 ever did on the same box. Enjoy, and happy coding!
1. Change your Look and Feel
Change your look and feel to something other than native. On Windows, the “IDEA (4.5 Default)?look and feel performs much better than the native one. On Mac, just pick something other than the native. The new graphics will bother you for about 30 minutes and then you’ll forget all about them. This setting is in the Settings (Ctrl+Alt+S) -> Appearance (B) dialog. (Tip courtesy of Howard Lewis Ship)
2. Use Structure View Instead of Project View
In IDEA 7.0.2 on Windows, I seem to pay a heavy performance price for the Project View (Alt+1), especially with autoscrolling to and from source enabled. My alternative is to use the Structure View (Alt+2) as my default sidebar and rely on the Navigation Bar (View->Navigation Bar) for project navigation. I find I actually prefer this setup and 7.0.2 performs noticeably faster.
3. Turn off Synchronize Files
When you activate the IDEA frame, IDEA will scan the disk for file changes, giving you a nice progress bar to wait for. If you’re not editing files outside of IDEA then turn this feature off in Settings (Ctrl+Alt+S) -> General (A). Uncheck “Synchronize Files on Frame Activation? Now you’ll have to manually synchronize the files using Ctrl+Alt+Y (File->Synchronize on the menu). (Tip courtesy of Tyler)
4. Disable Spring Model Validation on Build
I used to get a progress bar every time I ran or debugged my project, with the message “Validating Spring Model? I don’t need this feature except when I’m working on the Spring files, so I turned it off. Settings (Ctrl+Alt+S) -> Project Settings (1) -> Modules?then click Spring, then click the Options Tab. Deselect the checkbox for “Enable Spring model validation on build?
5. Disable Unused Plugins
Disable all of the plugins you are not currently using. For example, if you’re not using Geronimo, Commander or Jabber, then turn them off. Settings (Ctrl+Alt+S) -> Plugins (T). Uncheck anything you have installed that is unused (Tip courtesy of Carl)
6. Use Scopes to Speed Up Searches
I rarely really want to search my entire project for a string or reference. Any search dialog allows you to pick a custom scope, such as production files or test files. But “Changed Files?is a helpful option too. On large, monolithic projects you may want to define your own to only search certain packages. A little time creating new scopes will save you a lot of time in waiting for searches to complete. Define scopes in Settings (Ctrl+Alt+S) -> Scopes (5).
7. Increase Your Heap Size
Several sources include directions on increasing your heap size in IDEA. This is changed in your idea.exe.vmoptions file.
8. Always Get the Latest Version
I’ve already suggested this, so I’ll be brief. Each minor release seems to have good performance improvements.
9. Reduce Size of Local History
Another blog recommended that you turn off or reduce Local History. I love this feature so I’ll never turn it off, but the default is to save 3 days worth of work. I typically check in to version control more often than that, so I trimmed it up to 1 day of history. Do this in Settings (Ctrl+Alt+S) -> Local History (J).
10. Optimize Your Disk?
I haven’t tried this myself, but the tip came directly from JetBrains. Beyond just defragmenting, you can also optimize the MFT tables, disk folder structure, and the paging file. Direction appear on their site. Simply upgrading to a newer hard drive is find at home, but I don’t have that much control of my work machine. It’s Friday, so I’ll try this today. If things go horribly wrong I’ll redact the entry!
———————————————————————————————————————————————————————————————————————————?
IntelliJ IDEA Performance
There're some concerns about IntelliJ IDEA Performance. And here is the tips that I used to make mine run fast. Some of them come from my own experience, some of them come from the know-everything internet.
    * Make sure you have all your libraries on your local harddrive (as opposed to mounted network drive). After I moved all my libraries from a network drive to local harddrive, the time for a 'make' on the project is reduced from around 60 seconds to just 5-7 seconds!
    * Defragment your Disk and reboot your computer. IDEA creates lots of small files and too much fragmentation is a nightmare.
    * Turn off Anti Virus completely. Yes I mean completely. It affects the performance dramatically.
    * Turning off Local History or even reducing the number of history days improved the performance significantly.
    * Adjust VM settings. Here is my idea.exe.vmoptions file (on windows):
-Xms512m
-Xmx512m
-XX:MaxPermSize=99m
-ea
Change it as you see fit per your hardware configuration.
More information is available at http://blogs.jetbrains.com/idea/2006/04/configuring-intellij-idea-vm-options/.
    * The Debugger in IDEA may work slowly if the Force classic VM option is not selected in the File Project Properties Debugger dialog. Using Method Breakpoints may also slow down the debugging process. I had two breakpoints on the method name instead of the first line of the method. It was taking a half hour to get to the breakpoint Changing these to line breakpoints gave me two orders of magniture
    * You may notice IDEA hang for several seconds when you switch to it from other applicationDisable Settings General Synchronize files on frame activation.
    * Disable windows paging file if you have enough memory. Get more memory if you don't have enough. Swapping is a performance nightmare.
    * Turn off windows indexing services, either set it to Disabled or Manual unless you do lots of file system search (even you do, I recommend Google Desktop Search). IDEA use lots of small files so background indexing can have a big negative effect on it's performance.
    * Control Panel/System/Properties/Advanced/Visual Effcts, Adjust for best performance. Unless you're willing to sacrify performance for visual effects like windows animation, fading/sliding etc.



simplelove 2010-07-30 01:40 发表评论
]]>
斐L那契数列http://www.aygfsteel.com/ilovesimple/archive/2010/06/30/324842.htmlsimplelovesimpleloveWed, 30 Jun 2010 01:17:00 GMThttp://www.aygfsteel.com/ilovesimple/archive/2010/06/30/324842.htmlhttp://www.aygfsteel.com/ilovesimple/comments/324842.htmlhttp://www.aygfsteel.com/ilovesimple/archive/2010/06/30/324842.html#Feedback0http://www.aygfsteel.com/ilovesimple/comments/commentRss/324842.htmlhttp://www.aygfsteel.com/ilovesimple/services/trackbacks/324842.html一般而言Q兔子在出生两个月后Q就有繁D能力,一对兔子每个月能生Z对小兔子来。如果所有兔都不死,那么一q以后可以繁D多对兔子Q?

  我们不妨拿新出生的一对小兔子分析一下:

  W一个月兔子没有繁D能力,所以还是一?

  两个月后Q生下一对小兔民数共有两?

  三个月以后,老兔子又生下一对,因ؓ兔子还没有J殖能力Q所以一共是三对;

  Q-Q-Q-

  依次cL可以列出下表Q?

  所l过月数Q???????????0?1?2

  兔子ҎQ???????3?1?4?5?9?44?33

  表中数字1Q?Q?Q?Q?Q?Q-Q构成了一个序列。这个数列有兛_分明昄特点Q那是:前面盔R两项之和Q构成了后一V?

  q个数列是意大利中世U数学家斐L那契在<盘全书Q中提出的,q个U数的通项公式Q除了具有a(n+2)=an+a(n+1)/的性质外,q可以证明通项公式为:an=1/?[Q?/2Q√5/2)^ n-(1/2-?/2)^ n](n=1,2,3.....Q(?表示根号5Q?

  q个通项公式中虽然所有的an都是正整敎ͼ可是它们却是׃些无理数表示出来?/p>

simplelove 2010-06-30 09:17 发表评论
]]>
WeakHashMaphttp://www.aygfsteel.com/ilovesimple/archive/2010/06/08/323094.htmlsimplelovesimpleloveTue, 08 Jun 2010 12:40:00 GMThttp://www.aygfsteel.com/ilovesimple/archive/2010/06/08/323094.htmlhttp://www.aygfsteel.com/ilovesimple/comments/323094.htmlhttp://www.aygfsteel.com/ilovesimple/archive/2010/06/08/323094.html#Feedback0http://www.aygfsteel.com/ilovesimple/comments/commentRss/323094.htmlhttp://www.aygfsteel.com/ilovesimple/services/trackbacks/323094.htmlIf you want the entry to be garbage collected, use WeakHashMap. Once the key is not strongly referenced, the entry will be automatically reclaimed.

 

Here is a good article to understand this:

http://www.codeinstructions.com/2008/09/weakhashmap-is-not-cache-understanding.html



simplelove 2010-06-08 20:40 发表评论
]]>
Maven 2 的优点,开源的q是maven?/title><link>http://www.aygfsteel.com/ilovesimple/archive/2010/06/04/322756.html</link><dc:creator>simplelove</dc:creator><author>simplelove</author><pubDate>Fri, 04 Jun 2010 07:49:00 GMT</pubDate><guid>http://www.aygfsteel.com/ilovesimple/archive/2010/06/04/322756.html</guid><wfw:comment>http://www.aygfsteel.com/ilovesimple/comments/322756.html</wfw:comment><comments>http://www.aygfsteel.com/ilovesimple/archive/2010/06/04/322756.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/ilovesimple/comments/commentRss/322756.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/ilovesimple/services/trackbacks/322756.html</trackback:ping><description><![CDATA[<p>附录 A. 需要搞清楚几个问题<br>A.1. Maven2的优?br>  1.<br>  对第三方依赖库进行统一的版本管理?br>  只要用了Maven2׃用再为每个项目复制spring.jar和hibernate.jar了,Maven2会在你需要的时候,自动把这些第三方依赖库找刎ͼ你需要编译,Maven2把q些jar包放到classpath里,你需要打包,Maven2帮你把需要的jar包都复制到WEB- INF/lib/目录下?br>  2.<br>  l一目的目录结构?br>  可以保证所有项目的目录l构都是一LQ目录结构统一的好处就是,你要找源代码去src/main/java/下,你要N要放到classpath下的资源Q就去src/main/resources/下,你要扑֍元测试对应的代码和资源,去src/test/下。每个目录下放什么东西,E序~译Q发布的时候,每个目录起什么作用都很清楚明了,不会出现打开目找不到要扄文g的情c?br>  3.<br>  l一软g构徏阶段<br>  Maven2把Y件开发的q程划分成了几个l典阶段Q比如你先要生成一些java代码Q再把这些代码复制到特定位置Q然后编译代码,复制需要放?classpath下的资源Q再q行单元试Q单元测试都通过了才能进行打包,发布?br>  以前使用AntQ最令h头疼的就是要Z同的目写很多build.xml脚本Q而且q些脚本q不太通用Q现在我们可以用Maven2提供的这些经典构建阶D,让每个项目就l过相同的步骤,从源代码一步一步变成可以部|的成品。如果想要什么附加功能,把对应的插gl定C个构建阶D上Q那么到了执行这个构建阶D늚时候,׃执行l定的插件了?br>  4.<br>  支持多种插g<br>  在http://maven.apache.com/和http://mojo.codehaus.org/上可以找到大量的Maven2插gQ通过q些插g可以完成多种多样的扩展功能?br>  不过Q如果比插g的易用性,Ant的插件实际上更简单方便,与之相比Q在Maven2中配|插件的步骤太复杂了Q既要配|groupId?artifactIdQ还要配|绑定在哪个阶段q行?br>  不过因ؓMaven2可以把插件连同第三方依赖一赯行统一版本理Q所以这斚w也算比Ant有一点儿优势Q至用时不需要自己再M载插件的发布包了?br>  5.<br>  自动生成目|站和报?br>  如果说Ant可以使用ivy实现W三方依赖库的统一理Q如果说Ant可以自己l一目的目录结果,如果说Ant支持插g更灵z,那么q个Ҏ绝Ҏ Ant无法比拟的?br>  Maven2 可以自动为项目生成一个网站,里面包含了项目信息,参与人,目理相关的资源,W三方依赖库Q用的插gQ以及通过其他扩展插g生成的各U报表。Ant 使用某些插g也可以生成html格式的报表,但是各个报表之间都没什么关联,不像Maven2中将|站和报表都兌在一P查看h十分方便?br>A.2. Maven2的问?br>  1.<br>  Maven2使用前需要像Ant一样需要配|环境变量?br>  本来l色安装是一件好事,但是因ؓ太多人都只会用IDEQ不了解如何配置环境变量Q所以这W一步就很成问题?br>  2.<br>  Maven- 2.1.0本n只有2.844MQ可是这只是一个核心,实际使用Ӟq需要去公网上的资源库下载各U插Ӟ然后才能实现各种功能Q问题是公网上的资源库一般都是在国外Q网路速度E慢无法完成下载,没法下蝲没法用Maven2里提供的那些功能QMaven2q不v来?br>  其对于新手来说Q第一ơ下载插件的q程Q实在是太痛苦了Q大多数人都在这一阶段攑ּ了对Maven2的尝试?br>  3.<br>  W三方依赖库版本混ؕ?br>  java的依赖库理一直没有约定规范,D多个目Q引用多个第三方依赖Q这些第三方依赖又用同一个项目的不同版本的发布包Q最后就是弄得一团糟?br>  Maven2 试通过一些约定解册个版本؜q问题Q但实际上ƈ没有辑ֈ预想中的效果。例如,commons.apache.org中的目Q本来应该放?org/apache/commons/目录下,现在却都各自攑֜commons-loggingQcommons-langQcommons- beanutils目录下,估计q是因ؓ刚开始用Maven2的那些hQ懒得把常用包放到那么深的目录结构中Q偷懒放C目录下。可随着 Maven2的发展,加入资源库的包越来越多,他们又把新发布的依赖包按照正常的方式Q放Corg/apache/commons/目录下,而旧依赖q有很多人在用,所以也不能删除Q这造成了现在这U一U依赖库多种存放形式的问题?br>  每次在资源库上找依赖都要p很多旉Q因Z不清楚它I竟使用的哪U目录Ş式,比如sourceforge.net上的目有两种目录形式Q一些项目放在net/sf /目录下,而另一些例子放在net/sourceforge/目录下,所以你q知道目的网站地址Q也要在多个目录下都找一遍?br>  4.<br>  ~Z详细的教E?br>  入门教程一般都很简略,现在g使用的h多了hQ可以在|上扑ֈ一些新手教E,但是一般都很简略,只能自己玩玩Q实际中遇到问题的话Q还是很难解冟?br>  实际上Maven2的教E一直是一块短板,q是国外的两本书《Maven: The Definitive Guide 》和《Better Build With Maven》也没有涉及到富含h值高U技术?br>  q是讲的比较详l的Maven2教程Q也都是停留在Maven2本n的用上Q或者稍微提及一下用到得官ҎӞ对于很多强力的扩展插仉没有介绍?br>  至今很多人用Maven2都处在摸索阶D,没看到谁ȝZ用Maven2最佛_c这点上Q一般都是把国外开源项目中的pom.xml拿来研究学习?br>  5.<br>  资源库不完整<br>  一般来_我们可以从Maven2的资源库上下载到我们所需要的W三方依赖库Q但是有些依赖库在Maven2的资源库上是找不到的?br>  其中有因为发布协议的限制Q比如j2ee的一些规范api。有因ؓ目所在厂商的原因Q比如jbpm。有因ؓ目C֌的问题,比如birt。还有很多情冉|因ؓMaven2官方处理事情太慢Q很多小型开源项目,比如dozerQ虽然两个月前就已经提出了最新版本的上传甌Q但是迟q没有给予答复?br>  在这U情况下Q我们只能自己在本地资源库中安装需要的依赖了,造成的问题是Q如果相关的目使用了Maven2的项目管理文Ӟ那么可以使用Maven2 项目发布到本地库中Q这样一来就可以获得目自n的依赖设|。如果相关项目没有用Maven2的项目管理文Ӟ那么需要自己再Mؓq个目扑ֈ所需要的依赖Qƈ配置到对应的pom文g中,着实非帔R烦?br>  6.<br>  Maven2没有IDE支持<br>  没有良好的IDE支持也是个大问题Q虽然说有m2eclipseQ但是实际上g没那么易用?br>  本n我们没有使用m2eclipseQ而是使用maven2 + editplus的组合,不过介于q大开发者还是要用eclipse的,所以稍后我们还是会讨论到m2eclipse的相关知识?/p><img src ="http://www.aygfsteel.com/ilovesimple/aggbug/322756.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/ilovesimple/" target="_blank">simplelove</a> 2010-06-04 15:49 <a href="http://www.aygfsteel.com/ilovesimple/archive/2010/06/04/322756.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>l于把petstore2.0跑v?/title><link>http://www.aygfsteel.com/ilovesimple/archive/2010/05/23/321661.html</link><dc:creator>simplelove</dc:creator><author>simplelove</author><pubDate>Sun, 23 May 2010 07:51:00 GMT</pubDate><guid>http://www.aygfsteel.com/ilovesimple/archive/2010/05/23/321661.html</guid><wfw:comment>http://www.aygfsteel.com/ilovesimple/comments/321661.html</wfw:comment><comments>http://www.aygfsteel.com/ilovesimple/archive/2010/05/23/321661.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/ilovesimple/comments/commentRss/321661.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/ilovesimple/services/trackbacks/321661.html</trackback:ping><description><![CDATA[<p>follow steps 不用netbeanQ按照下文的指示手工操作?/p> <p><a title="http://dev.firnow.com/course/3_program/java/javajs/20090507/166773.html" >http://dev.firnow.com/course/3_program/java/javajs/20090507/166773.html</a></p> <p>到问题Q?/p> <p>在执?ant -f build.xml setup的时候会报一个错?br>q接到端?527上的服务器localhost 时出?消息未connetion refused:connect <p>  <p>原因是java derby db 没有启动?<p>解决ҎQ启动它 <p><glassfish_dir>/bin/asadmin start-database <p><glassfish_dir>指的是glassfish的安装目?/p><img src ="http://www.aygfsteel.com/ilovesimple/aggbug/321661.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/ilovesimple/" target="_blank">simplelove</a> 2010-05-23 15:51 <a href="http://www.aygfsteel.com/ilovesimple/archive/2010/05/23/321661.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Gmail is very serious about its securityhttp://www.aygfsteel.com/ilovesimple/archive/2010/04/16/318494.htmlsimplelovesimpleloveFri, 16 Apr 2010 03:26:00 GMThttp://www.aygfsteel.com/ilovesimple/archive/2010/04/16/318494.htmlhttp://www.aygfsteel.com/ilovesimple/comments/318494.htmlhttp://www.aygfsteel.com/ilovesimple/archive/2010/04/16/318494.html#Feedback0http://www.aygfsteel.com/ilovesimple/comments/commentRss/318494.htmlhttp://www.aygfsteel.com/ilovesimple/services/trackbacks/318494.htmlimage

I got above error notes shows google take serious consideration about its security.



simplelove 2010-04-16 11:26 发表评论
]]>
a manifest file examplehttp://www.aygfsteel.com/ilovesimple/archive/2010/02/20/313453.htmlsimplelovesimpleloveSat, 20 Feb 2010 06:15:00 GMThttp://www.aygfsteel.com/ilovesimple/archive/2010/02/20/313453.htmlhttp://www.aygfsteel.com/ilovesimple/comments/313453.htmlhttp://www.aygfsteel.com/ilovesimple/archive/2010/02/20/313453.html#Feedback0http://www.aygfsteel.com/ilovesimple/comments/commentRss/313453.htmlhttp://www.aygfsteel.com/ilovesimple/services/trackbacks/313453.html
  • must end with a new line
  • Main-Class attribute is case sensitive
  • file name is random, file extension is mf, eg. mymanifest.mf
  • example jar command to package a app: jar cfm myapp.jar MANIFEST.MF *.*
  • egQ?br />
    Manifest-Version: 1.0
    Main-Class: ButtonTest




    simplelove 2010-02-20 14:15 发表评论
    ]]>
    AWT vs Swing (from http://edn.embarcadero.com/article/26970)http://www.aygfsteel.com/ilovesimple/archive/2010/02/15/313097.htmlsimplelovesimpleloveMon, 15 Feb 2010 02:58:00 GMThttp://www.aygfsteel.com/ilovesimple/archive/2010/02/15/313097.htmlhttp://www.aygfsteel.com/ilovesimple/comments/313097.htmlhttp://www.aygfsteel.com/ilovesimple/archive/2010/02/15/313097.html#Feedback0http://www.aygfsteel.com/ilovesimple/comments/commentRss/313097.htmlhttp://www.aygfsteel.com/ilovesimple/services/trackbacks/313097.html

    When developing a Java program it is important to select the appropriate Java Graphical User Interface (GUI) components. There are two basic sets of components that you will most likely build your Java programs with. These two groups of components are called the Abstract Window Toolkit (AWT) and Swing. Both of these groups of components are part of the Java Foundation Classes (JFC).

    An Overview of the AWT

    AWT stands for Abstract Window ToolKit. The Abstract Window Toolkit supports GUI Java programming. It is a portable GUI library for stand-alone applications and/or applets. The Abstract Window Toolkit provides the connection between your application and the native GUI. The AWT provides a high level of abstraction for your Java program since it hides you from the underlying details of the GUI your program will be running on.

    AWT features include:

    • A rich set of user interface components.
    • A robust event-handling model.
    • Graphics and imaging tools, including shape, color, and font classes.
    • Layout managers, for flexible window layouts that don't depend on a particular window size or screen resolution.
    • Data transfer classes, for cut-and-paste through the native platform clipboard.

    The AWT components depend on native code counterparts (called peers) to handle their functionality. Thus, these components are often called "heavyweight" components.

    An Overview of Swing

    Swing implements a set of GUI components that build on AWT technology and provide a pluggable look and feel. Swing is implemented entirely in the Java programming language, and is based on the JDK 1.1 Lightweight UI Framework.

    Swing features include:

    • All the features of AWT.
    • 100% Pure Java certified versions of the existing AWT component set (Button, Scrollbar, Label, etc.).
    • A rich set of higher-level components (such as tree view, list box, and tabbed panes).
    • Pure Java design, no reliance on peers.
    • Pluggable Look and Feel.

    Swing components do not depend on peers to handle their functionality. Thus, these components are often called "lightweight" components.

    AWT vs. Swing

    There are, of course, both pros and cons to using either set of components from the JFC in your Java applications. Here is a summary:


    AWT:
    Pros

    • Speed: use of native peers speeds component performance.
    • Applet Portability: most Web browsers support AWT classes so AWT applets can run without the Java plugin.
    • Look and Feel: AWT components more closely reflect the look and feel of the OS they run on.
    Cons
    • Portability: use of native peers creates platform specific limitations. Some components may not function at all on some platforms.
    • Third Party Development: the majority of component makers, including Borland and Sun, base new component development on Swing components. There is a much smaller set of AWT components available, thus placing the burden on the programmer to create his or her own AWT-based components.
    • Features: AWT components do not support features like icons and tool-tips.

    Swing:
    Pros

    • Portability: Pure Java design provides for fewer platform specific limitations.
    • Behavior: Pure Java design allows for a greater range of behavior for Swing components since they are not limited by the native peers that AWT uses.
    • Features: Swing supports a wider range of features like icons and pop-up tool-tips for components.
    • Vendor Support: Swing development is more active. Sun puts much more energy into making Swing robust.
    • Look and Feel: The pluggable look and feel lets you design a single set of GUI components that can automatically have the look and feel of any OS platform (Microsoft Windows, Solaris, Macintosh, etc.). It also makes it easier to make global changes to your Java programs that provide greater accessibility (like picking a hi-contrast color scheme or changing all the fonts in all dialogs, etc.).
    Cons
    • Applet Portability: Most Web browsers do not include the Swing classes, so the Java plugin must be used.
    • Performance: Swing components are generally slower and buggier than AWT, due to both the fact that they are pure Java and to video issues on various platforms. Since Swing components handle their own painting (rather than using native API's like DirectX on Windows) you may run into graphical glitches.
    • Look and Feel: Even when Swing components are set to use the look and feel of the OS they are run on, they may not look like their native counterparts.


    simplelove 2010-02-15 10:58 发表评论
    ]]>
    վ֩ģ壺 | | ƽȪ| | ï| ɽ| | | | | | | | Զ| | կ| е| ӡ| | | Ӽ| Դ| | | | лͨ| Դ| | | | | ԭ| | | ľ| | | ǭ| IJ| ԣ| |