Raw materials:
Eclipse
Swt. The download link is:
Eclipse 4.6.2 Release build:4.6.2
Configuration Description:
Developing SWT applications using Eclipse
Steps:
1. Download SWT in. zip format
2. Import Swt**.zip to eclipse,file-->import-->import and select the Existing Projects into workspace-- >select Archivie file-->finish
OK, it's almost done.
3. Testing
3.1 Create a new Java project
Set properties, Java Build path--Prject-->add-->swt-->ok
3.2 Creating a new Java program
ImportOrg.eclipse.swt.widgets.Display;ImportOrg.eclipse.swt.widgets.Shell;/*** Hello world! **/ Public classApp { Public Static voidMain (string[] args) {display display=NewDisplay (); Shell Shell=NewShell (display); Shell.settext ("Hello world!"); Shell.open (); while(!shell.isdisposed ()) { if(!Display.readanddispatch ()) display.sleep (); } display.dispose (); }}
3.3 Run
Select Helloworld.java, and then click the inverted triangle next to the right triangle button on the toolbar, and select the Run as-java Application command to run the HelloWorld class. The exact operation is as follows:
The results of the final operation are as follows:
OK,SWT environment is completed. This may not be easy to use, next, using a plugin, drag the control directly into the panel
Reference official documents: https://www.eclipse.org/swt/eclipse.php
P.S still read the official website document.
--------------------------------------------------------------I'm updating the split line------------------------------------------------
Direct use of Eclipse-->install software
Mars-http://download.eclipse.org/releases/mars
Select SWT and Windsbuilder to
Wait for installation to complete
OK, restart eclipse
Other reference documents:
Eclipse SWT Development Environment Building
Eclipse SWT Development Environment Building