Launching standalone SWT Examples inside Eclipse

Run a standalone example by selecting the main class (e.g. org.eclipse.swt.examples.controlexample.ControlExample) and selecting
Run > Run As > Java Application (Note: prior to Eclipse 3.3 use
Run > Run As > SWT Application).

Running standalone SWT Examples outside of Eclipse

(NOTE: these instructions will only work for Eclipse 3.3 and newer) To run the ControlExample or CustomControlExample standalone:

Click on the Eclipse build that you would like examples for
(i.e. the Eclipse/SWT build that you are running; typically the latest Stable Build).

Scroll down until you see "Example Plug-ins", download the .zip for your platform, and extract it to your local machine.

In the directory with the extracted example plug-ins, find file org.eclipse.swt.examples_<version>.jar, and extract it in place.

Open a DOS window (on Windows) or a terminal window (on Mac or Linux) and navigate to this directory.

To run the example, type the following line with the appropriate paths substituted:<pathToYourJRE>\bin\java -classpath <pathOfYourPlatformSWTjar>;.\swtexamples.jar org.eclipse.swt.examples.controlexample.ControlExample

This is the ControlExample. There is a tab for each control, and you can
change the various styles, etc, to see what changes in the controls. To run
the CustomControlExample simply use the class name CustomControlExample
instead of ControlExample in step 6.