Posted on 2009-08-06 22:12
zht 閱讀(7400)
評(píng)論(7) 編輯 收藏 所屬分類:
Swing
對(duì)于剛接觸Swing的開(kāi)發(fā)人員,由于水平所限,需要一個(gè)可視化的開(kāi)發(fā)工具,來(lái)輔助理解學(xué)習(xí)和開(kāi)發(fā)。也有時(shí)候是工作緊迫,需要可視化工具來(lái)提高工作效率,節(jié)省寶貴的時(shí)間。
在此介紹下,如何可視化開(kāi)發(fā)Swing組件。現(xiàn)在Java主流的兩款開(kāi)發(fā)工具NetBeans和Eclipse都提供了可視化的功能。
一、NetBeans
這個(gè)無(wú)需多言,Sun官方推薦的Swing開(kāi)發(fā)工具,自身已經(jīng)集成了可視化工具。
下載地址:
http://www.netbeans.org/downloads/index.html
二、Eclipse
Eclipse本身不提供可視化功能,需要插件來(lái)輔助。
我了解到的,比較常用的插件有兩種
1、Visual Editor 簡(jiǎn)稱VE
關(guān)于安裝 請(qǐng)參考
http://wiki.eclipse.org/VE/Installing/Archived
說(shuō)明如下:
VE Installation
Make sure eclipse is close.
Go to http://sourceforge.net/project/showfiles.php?group_id=131065&package_id=154855
Click "Visual Editor patched as in bug 202562"
Click org.eclipse.visualeditor-1.3.0.200709121813.zip
Unpack the .zip file somewhere
In that extracted folder, there is an " org.eclipse.visualeditor-1.3.0.200709121813" subdir, copy what's in that directory to your eclipse installation dir, say yes if prompted to overwrite.
Open eclipse again and go to Window->Preferences->Java. If after expanding 'Java' you see Visual Editor at the bottom, then you are good to go.
下載地址
http://sourceforge.net/projects/easyeclipse/files/Various%20Patches/Visual%20Editor%20patched%20as%20in%20bug%20202562/org.eclipse.visualeditor-1.3.0.200709121813-2.zip/download
2、jigloo
這個(gè)以前用過(guò),感覺(jué)還可以。
官方網(wǎng)站是
http://cloudgarden.com/jigloo/
下載網(wǎng)址
http://cloudgarden.com/jigloo/dnld_redirect.html
安裝說(shuō)明
Please note: if you have installed 4.0 RC1 or RC2 you will need to delete these folders from the plugins and features folders in eclipse before installing version 4.0.
Alternatively, you can download the zip file from here. Unzip it into the eclipse folder so that the structure is eclipse/plugins/com.cloudgarden.jigloo_4.0.0
安裝都很簡(jiǎn)單,建議使用link的方式來(lái)安裝Eclipse插件,方便插件管理,如下所示:
解壓yourplugin.zip到任意目錄下,比如D:\eclipseplugins\yourplugin。
在Eclipse的目錄下有個(gè)links文件夾,在里面新建文件,命名為anyname.link,編輯此文件,加入如下內(nèi)容并保存。path = D:/eclipseplugins/yourplugin
詳細(xì)使用,請(qǐng)自行搜索。
其它還有
jformdesigner
官方網(wǎng)址:http://www.jformdesigner.com/
Visual Swing Designer for Eclipse
開(kāi)源網(wǎng)址: http://code.google.com/p/visualswing4eclipse/
WindowBuilder
官方網(wǎng)址:http://www.instantiations.com/windowbuilder/
附
使用可視化工具拖拽編寫(xiě)Swing程序,一定要注意變量名和代碼的可讀性,否則代碼非常讓人崩潰。