Like most third-party packages, the SWT packages are in a JAR file. SWT is a little different from other packages, though, in that it is not "100% Pure Java," meaning that there is at least one component to the SWT package that is not contained in a JAR file. For SWT, this is a special file that interfaces between the Java classes and the operating system. In Windows, this is a DLL file. In this step, you'll see one way of including this (or any other) DLL in your environment. Later we'll show you a more pervasive way.
q 9.3(a) Make sure the SWT project is selected.
q 9.3(b) Right-click in the Package Explorer and select File/New/Class.
q 9.3(c) Make sure the Source Folder is SWT.
q 9.3(d) Leave Package blank.
q 9.3(e) Leave Enclosing type unchecked.
q 9.3(f) Enter HelloSWT in the Name field.
q 9.3(g) Make sure public is checked, abstract and final unchecked.
q 9.3(h) Leave Superclass as java.lang.Object, Interfaces blank.
q 9.3(i) Make sure public static void main(String[] args) is checked.
q 9.3(j) Leave the other two unchecked.
q 9.3(k) Select Finish.
This will create a class HelloSWT in the default package (because you left Package blank) in project SWT. It will be a public class, neither abstract nor final. The class has no superclass (except for the implied superclass Object) and implements no interfaces. Finally, the IDE has been instructed to create a standard "main" method, but no other methods . That being the case, we will see the result as in Figure 9.13.