<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | |
<title>How to Setup SWT Examples</title> | |
</head> | |
<body> | |
<h2> | |
<b>Standalone Examples Setup - Standard Widget Toolkit (SWT)</b></h2> | |
<h3> | |
Setup</h3> | |
There are several steps required before the SWT standalone examples can | |
be run. | |
<ul> | |
<li> | |
Copy the <b>swt runtime library</b> on the system path [System.getProperty("java.library.path:)]. | |
On Linux, this is LD_LIBRARY_PATH. (Is LD_LIBRARY_PATH applicable | |
to all shells?).</li> | |
<ul>The <b>swt runtime library</b> can be found in the following directory, | |
depending one which Operating System you are using to run Eclipse: | |
<ul> | |
<li> | |
Windows - <install-dir>\eclipse\plugins\org.eclipse.swt\ws\win32\</li> | |
<li> | |
Motif - <install-dir>/eclipse/plugins/org.eclipse.swt/ws/motif/</li> | |
</ul> | |
</ul> | |
<li> | |
Create a Java Project to contain the examples. Call it "SWT Examples".</li> | |
<li> | |
Make sure the <b>swt.jar</b> file is on the java classpath.</li> | |
<br>Select the SWT Examples project and bring up the Properties dialog. | |
On the Java Build Path page, select the Libraries tab, click on the Add | |
External JARs button and find <b>swt.jar</b>. The <b>swt.jar</b> | |
file can be found in the following directory, depending one which Operating | |
System you are using to run Eclipse: | |
<ul> | |
<li> | |
Windows - <install-dir>\eclipse\plugins\org.eclipse.swt\</li> | |
<br>Motif - <install-dir>/eclipse/plugins/org.eclipse.swt/</ul> | |
<li> | |
Make sure the <b>swtexamples.jar</b> is on the java classpath.</li> | |
<br>Select the SWT Examples project and bring up the Properties dialog. | |
On the Java Build Path page, select the Libraries tab, click on the Add | |
External JARs button and find <b>swtexamples.jar</b>. The <b>swtexamples.jar</b> | |
file can be found in the following directory, depending one which Operating | |
System you are using to run Eclipse: | |
<ul> | |
<li> | |
Windows - <install-dir>\eclipse\plugins\org.eclipse.swt.examples</li> | |
<br>Motif - <install-dir>/eclipse/plugins/org.eclipse.swt.examples/</ul> | |
</ul> | |
<h3> | |
<a NAME="Run"></a>Running the Examples</h3> | |
In the Packages view of the Java Perspective, expand <b>swtexamples.jar</b>. | |
You will see all of the packages and other resource files present in the | |
jar file. | |
<p>All of the standalone SWT examples are intended to be run as a Java | |
Application. No parameters need be passed to any of these examples | |
in order to run the example. To run one of the example classes, simply | |
expand the containing package of the runnable class, select the runnable | |
class, then click on the Run button on the toolbar. | |
<p>The runnable classes in the <b>swtexamples.jar</b> are: | |
<ul> | |
<li> | |
org.eclipse.swt.examples.addressbook.AddressBook</li> | |
<li> | |
org.eclipse.swt.examples.fileviewer.FileViewer</li> | |
<li> | |
org.eclipse.swt.examples.helloworld.HelloWorld1</li> | |
<li> | |
org.eclipse.swt.examples.helloworld.HelloWorld2</li> | |
<li> | |
org.eclipse.swt.examples.helloworld.HelloWorld3</li> | |
<li> | |
org.eclipse.swt.examples.helloworld.HelloWorld4</li> | |
<li> | |
org.eclipse.swt.examples.helloworld.HelloWorld5</li> | |
<li> | |
org.eclipse.swt.examples.hoverhelp.HoverHelp</li> | |
<li> | |
org.eclipse.swt.examples.imageanalyzer.ImageAnalyzer</li> | |
<li> | |
org.eclipse.swt.examples.javaviewer.JavaViewer</li> | |
<li> | |
org.eclipse.swt.examples.texteditor.TextEditor</li> | |
</ul> | |
<p><br><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corporation 2000" BORDER=0 height=12 width=195></a> | |
</body> | |
</html> |