Complete walkthrough on how to create a starter Java GUI Application with Standard Widget Toolkit.



Download Eclipse.
Windows 32 bit.
206MB
Notice the warning center screen. I have Java 1.6.0 update 21 so I have to do this.
I choose to do item #2 to remedy this problem.
Extract the eclipse-jee-helios-win32.zip
Here is the contents of the extract.
Here is install instructions for eclipse.
Drag and drop the extracted files to C:\Program Files
Open up the eclipse.ini file here is the default.
Adding the line as instructed to fix the crash/freeze issue.
Pull the eclipse icon to the desktop.
Launch Eclipse for the first time.
Take the hello world tutorial if you want.
OK, start building a Hello World SWT application.
File ->New java project. Name it HelloWorldSWT. Click Finish.
Download the SWT Binary and source for your operating system. I used the one selected on the left here.
It is a zip file.
Find the files directory for the project you just made. Right click your HelloWorldSWT Project and click properties and resource. Go to that directory.
Here I am inside the source files for the java project.
Move the zip file into there. Extract the files in there.
You should have two jar files. swt.jar and swt-debug.jar
Right click HelloWorldSWT go to properties, click Java Build Path. Click Libraries, click Add External Jars.
They should be added like this. Click ok.
Right click src directory, click new Class.
Name it helloWorldSWT, check public static void main.
Here is the basic code to bring up a window using the SWT.
Left click the red exclamation point, choose Import Shell
Left click the red exclamation point, choose Import Display
Right click the project, click run as java application. BAM!