用Eclipse开发SWT程序配置入门

Developing SWT applications using Eclipse

While SWT is integrated as part of the Eclipse

 plug-in API, for standalone application development it is best to develop against the SWT standalone download. 

This document will help you get set up.

First, download the .zip of SWT for your platform from the SWT homepage.

The SWT .zip file can then be imported into your workspace. In the File menu, choose Import and select the Existing Projects Into Workspace wizard. 

(In newer versions of eclipse, you can find Existing Projects Into Workspace in the General category).

 

用Eclipse开发SWT程序配置入门_第1张图片

Direct the wizard to the location where you downloaded the .zip file. This will create a project called org.eclipse.swt in your workspace.

 

用Eclipse开发SWT程序配置入门_第2张图片

Your Java projects can then add the SWT project as a dependency. Open the properties dialog of your Java project,

 and on the Java Build Path page, include the org.eclipse.swt project.

 

用Eclipse开发SWT程序配置入门_第3张图片

With the SWT project as a dependency, you can now benefit from Eclipse features such as the Javadoc view and code assist.

 

用Eclipse开发SWT程序配置入门_第4张图片

Now you can run any main class in your project by selecting the class and then selecting Run > Run As > Java Application

你可能感兴趣的:(用Eclipse开发SWT程序配置入门)