Swing


天行健 君子以自强不息

posts - 69, comments - 215, trackbacks - 0, articles - 16
   :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

Swing可视化开发工具

Posted on 2009-08-06 22:12 zht 阅读(7365) 评论(7)  编辑  收藏 所属分类: Swing

对于刚接触Swing的开发人员,由于水平所限,需要一个可视化的开发工具,来辅助理解学习和开发。也有时候是工作紧迫,需要可视化工具来提高工作效率,节省宝贵的时间。

在此介绍下,如何可视化开发Swing组件。现在Java主流的两款开发工具NetBeans和Eclipse都提供了可视化的功能。

一、NetBeans
这个无需多言,Sun官方推荐的Swing开发工具,自身已经集成了可视化工具。
下载地址:
http://www.netbeans.org/downloads/index.html

二、Eclipse
Eclipse本身不提供可视化功能,需要插件来辅助。
我了解到的,比较常用的插件有两种
1、Visual Editor  简称VE
关于安装 请参考
http://wiki.eclipse.org/VE/Installing/Archived

说明如下:
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
这个以前用过,感觉还可以。
官方网站是
http://cloudgarden.com/jigloo/

下载网址
http://cloudgarden.com/jigloo/dnld_redirect.html

安装说明
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

 

安装都很简单,建议使用link的方式来安装Eclipse插件,方便插件管理,如下所示:
解压yourplugin.zip到任意目录下,比如D:\eclipseplugins\yourplugin。
在Eclipse的目录下有个links文件夹,在里面新建文件,命名为anyname.link,编辑此文件,加入如下内容并保存。path = D:/eclipseplugins/yourplugin
详细使用,请自行搜索。

其它还有

jformdesigner

官方网址:http://www.jformdesigner.com/


Visual Swing Designer for Eclipse

开源网址: http://code.google.com/p/visualswing4eclipse/


WindowBuilder

官方网址:http://www.instantiations.com/windowbuilder/


使用可视化工具拖拽编写Swing程序,一定要注意变量名和代码的可读性,否则代码非常让人崩溃。