SWT, the Standard Widget Toolkit, will help us to draw windows for the Java platform.
On this webpage you will find links to download last stable releases http://www.eclipse.org/swt/
Once downloaded, open Eclipse, right click on the Explorer tab, then : Import... > General > Existing Projects into Workspace.
Click Next then select the Select archive file option and browse until, for example for Windows OS, your swt-3.7.1-win32-win32-x86.zip file.
Click Finish.
Now in your Package Explorer you can see the org.eclipse.swt project.
Right click in this Explorer to create a new Java project named for example project1.
Right click on project1 > Build Path > Configure Build Path > Java Build Path.
On the right there are several tabs.
Select Projects and click Add...
Select org.eclipse.swt and click OK.
You project project1 is now linked with SWT and you can use its classes.
![]()
Comments
TheCric (not verified)
Tuesday, December 6, 2011 - 3:56am
Permalink
Thank You Mi-K !!!
Thank You Mi-K !!!
HelloWorldSWT which is the 1st example of SWT given after the installation of Eclipse does not work on Windows (I just tested it on Seven).
Yypically you get those errors:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-win32-3738 in java.library.path
no swt-win32 in java.library.path
Can't load library: C:\Users\<YourUserName>\.swt\lib\win32\x86\swt-win32-3738.dll
Can't load library: C:\Users\<YourUserName>\.swt\lib\win32\x86\swt-win32.dll
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:285)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:194)
at org.eclipse.swt.internal.C.<clinit>(C.java:21)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:138)
at HelloWorldSWT.main(HelloWorldSWT.java:13)
After the download of swt-3.7.1-win32-win32-x86.zip and by following the above given explanations by Mi-K, it just works.
By the way you can find swt-3.7.1-win32-win32-x86.zip for example here:
http://eclipse.ialto.com/eclipse/downloads/drops/R-3.7.1-201109091335/
Summer (not verified)
Wednesday, December 7, 2011 - 3:14am
Permalink
Yes, this fix worked for me
Yes, this fix worked for me as well. Thanks for that!
The Dafty Sage (not verified)
Monday, January 23, 2012 - 9:27pm
Permalink
They should add this step to
They should add this step to the tutorial :-D
Meg (not verified)
Wednesday, February 8, 2012 - 7:44pm
Permalink
Yes this does work - in my
Yes this does work - in my eclipse you have to right click on your project and select "Properties" and then navigate to the build path screen.
Thank you!
Mario (not verified)
Saturday, March 10, 2012 - 12:59pm
Permalink
Thank you so much, these
Thank you so much, these steps fix my problem.
Add new comment