As far as we're concerned in this chapter, what's attractive about the SWT is that it includes a Browser class that lets you create Browser widgets. So how do you get the SWT for use in your applications? The support for the SWT is in a JAR file named swt.jar, and you can get that file simply by downloading the current Eclipse zip/tar.gz file, which contains swt.jar. Navigate to http://www.eclipse.org, click the Downloads button, and select the compressed file for your operating system. As of this writing, that's eclipse-SDK-3.0.1-win32.zip for Windows, eclipse-SDK-3.0.1-linux-motif.zip for Linux x86/Motif, eclipse-SDK-3.0.1-linux-gtk.zip for Linux x86/GTK 2, and so onthey're all listed on the Downloads page. Decompress the compressed file, which will give you the swt.jar file (along with many, many other files) you'll need for this project. You're also going to need the precompiled native support for the SWT in order to run SWT programs. This is where the SWT's fast connection to the operating system is implemented. For example, in the current Windows version of Eclipse, those files are swt-awt-win32-3063.dll and swt-win32-3063.dll, so place them in the directory you're going to run the Browser project from. How can you find which precompiled files you need for your operating system? If you expand the Eclipse zip/tar.gz file, you'll find them in the following directories. Make sure you copy the files you find there to the directory where you're creating the Browser project (replace the 3.0.1 part in these paths with the version of Eclipse you download):
That gives you the support you're going to need to run SWT applications. So how about creating one? |