blob: cb6b54720e0061a9f7f36385fad19dc135964ed4 [file] [log] [blame]
<!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>SWT Standalone Examples Manual Setup</title>
</head>
<body>
<h2>Standard Widget Toolkit (SWT) - Standalone Examples Manual Setup</h2>
<h3>Setup</h3>
<p>There are several steps required to run the SWT standalone examples manually.
</p>
<ul>
<li><p>
Create a Java Project to contain the examples.&nbsp; Call it <b>SWT Examples</b>.
</p>
<li><p>
Make sure the <b>swt.jar</b> file is on the java classpath, by doing the following:<br>
Select the SWT Examples Project and bring up the Properties dialog.<br>
On the Java Build Path page, select the Libraries tab, click on the Add External JARs button and select <b>swt.jar</b>.<br>
Next, click on the Attach Source button, then click on the Browse File System button and select <b>swtsrc.zip</b>.<br>
The files can be found in the following directory, depending one which Operating System you are using to run Eclipse:
<ul>
<li>Windows - &lt;install-dir&gt;\eclipse\plugins\org.eclipse.swt\
<li>Motif - &lt;install-dir&gt;/eclipse/plugins/org.eclipse.swt/
</ul>
Click OK to save the Project properties.<br>
</p>
<li><p>
Make sure the <b>swtexamples.jar</b> is on the java classpath, by doing the following:<br>
Select the SWT Examples Project and bring up the Properties dialog.<br>
On the Java Build Path page, select the Libraries tab, click on the Add External JARs button and select <b>swtexamples.jar</b>.<br>
Next, click on the Attach Source button, then click on the Browse File System button and select <b>swtexamplessrc.zip</b>.<br>
The files can be found in the following directory, depending one which Operating System you are using to run Eclipse:
<ul>
<li>Windows - &lt;install-dir&gt;\eclipse\plugins\org.eclipse.swt.examples\
<li>Motif - &lt;install-dir&gt;/eclipse/plugins/org.eclipse.swt.examples/
</ul>
Click OK to save the Project properties.<br>
</p>
<li><p>
Make sure that referenced libraries are visible in the Packages view, by doing the following:<br>
In the Packages view of the Java Perspective, drop down the View menu.<br>
Ensure that <b>Show Referenced Libraries</b> is checked.
</p>
<li><p>
Make sure the <b>SWT runtime library</b> is in the library search path, by doing the following:<br>
In the Packages view of the Java Perspective, expand <b>swtexamples.jar</b>.<br>
You will see all of the packages and other resource files present in the jar file, including the executable class for each example.<br>
Select the executable class (the one containing the main() method) for the particular example that you wish to run and bring up the Properties dialog.<br>
On the Execution Arguments page, select the VM arguments field and enter <b>-Djava.library.path=&lt;runtime-library-path&gt;</b>.<br>
The runtime library path is the following directory, depending one which Operating System you are using to run Eclipse:
<ul>
<li>Windows - &lt;install-dir&gt;\eclipse\plugins\org.eclipse.swt\ws\win32
<li>Motif - &lt;install-dir&gt;/eclipse/plugins/org.eclipse.swt/ws/motif
</ul>
Click OK to save the Java Resource properties.<br>
</p>
</ul>
<h3><a NAME="Run"></a>Running the Examples</h3>
<p>In the Packages view of the Java Perspective, expand <b>swtexamples.jar</b>.&nbsp;
You will see all of the packages and other resource files present in the jar file,
including the executable class for each example.
</p>
<p>All of the standalone SWT examples are intended to be run as Java
Applications.&nbsp; No parameters need be passed to any of these examples,
other than any required VM arguments.&nbsp; To run an example, simply
select the executable class for the particular example, then click the Run button on the toolbar.
</p>
<h3><a NAME="Package"></a>Examples Manifest</h3>
<p>Consult the documentation of each individual example for the names of
its executable class(es) and additional details.
</p>
<p>
<code>swtexamples.jar</code> contains the following examples:
<ul>
<li><a href="swt_addressbook_ex.html">Address Book</a>
<li><a href="swt_fileviewer_ex.html">File Viewer</a>
<li><a href="swt_helloworld_ex.html">Hello World [1-5]</a>
<li><a href="swt_hoverhelp_ex.html">Hover Help</a>
<li><a href="swt_imageanalyzer_ex.html">Image Analyzer</a>
<li><a href="swt_javaviewer_ex.html">Java Viewer</a>
<li><a href="swt_texteditor_ex.html">Text Editor</a>
</ul>
</p>
<p><br><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corporation 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a>
</body>
</html>