org.eclipse.swt.examples/doc-html/swt_manual_setup.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.26 - (download) (as text) (annotate)
Thu Oct 26 20:10:59 2006 UTC (3 years, 1 month ago) by carolyn
Branch: MAIN
CVS Tags: v3440, v3441, v3509c, v3509b, v3509a, v3509e, v3509d, BEFORE_COPYRIGHT_BASH_FOR_33RC3, v3422a, v3437, R3_4, v3434, v3432, v3431, R3_5, v3439, R3_3, v3503, v3501, v3507, v3509, v3508, v3341, Root_accessibility_work_R3_6, v3619, v3617, v3616, v3615, v3614, v3613, v3612, v3611, v3610, AFTER_COPYRIGHT_BASH_FOR_33RC3, v3545, v3544, v3543, v3542, v3541, v3540, v3549, v3548, v3445c, R3_3_1_1, v3317, v3314, v3519, Root_R3_3_maintenance, v3504a, v3504b, v3536a, v3536b, v3556f, v3556e, v3556d, v3556c, v3556b, v3556a, v3544a, v3513, v3420, v3421, v3423, v3424, v3425, v3426, v3427, v3428, v3429, pre_R3_3, v3451, v3320c, v3514, v3515, v3516, v3510, v3511, v3512, v3333b, v3333f, v3608, v3609, v3600, v3601, v3602, v3603, v3604, v3605, v3606, v3607, v3548h, v3552b, v3552a, v3548b, v3548c, v3548d, v3548e, v3548f, v3548g, v3420a, v3550, v3551, v3552, v3553, v3554, v3555, v3556, v3557, v3419, v3410, v3412, v3415, v3620a, v3527, v3523, v3529, v3555a, v3321, v3327, v3325, v3328, v3448f, v3448e, v3448d, v3448c, v3448b, v3448a, v3611d, v3611c, v3611b, v3611a, v35178, v3415c, v3344d, v3529a, v3443, v3551b, v3551a, v3547a, v3545a, v3547b, R3_4_2, R3_4_1, v3501b, v3501a, v3554b, v3549b, v3549a, v3409, v3442a, v3406, v3536, v3537, v3534, v3535, v3532, v3533, v3530, v3531, v3538, v3539, v3416a, v3604a, v3526a, v3526b, v3334, v3337, v3330, v3332, v3620, v3621, v3451a, v3550a, v3550b, R3_5_1, v3314c, v3314a, Root_DateTime_DROP_DOWN, v3618, R3_3_1, R3_3_2, v3345a, v3534a, v3447, HEAD
Branch point for: R3_3_1_maintenance, accessibility_work_R3_6, DateTime_DROP_DOWN, R3_3_maintenance, R3_4_maintenance, R3_5_maintenance
Changes since 1.25: +1 -1 lines
add how to run examples
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <title>SWT Standalone Examples Setup</title>
</head>
<body>

<h2>SWT standalone examples setup</h2>

<h3>Adding SWT to your workspace</h3>

<ol>
<li>Download SWT for standalone applications.  A standalone version of SWT is available 
on the same download page as the Eclipse SDK.  Look for the section titled 
<strong>SWT Binary and Source</strong>.  Do not extract the archive file, just save it to disk.
<li>Select <strong>Import...</strong> from the <strong>File</strong> menu.</li>
<li>Select <strong>Existing Projects into Workspace</strong> and click on the <strong>Next</strong> button.</li>
<li>Select <strong>Select archive file:</strong> and use the <strong>Browse</strong> button to locate the SWT 
standalone archive you have previously downloaded.</li>
<li>Click on the <strong>Finish</strong> button.</li>
</ol>

<h3>Importing example source</h3>

<ol>
<li>Download and install the Eclipse Example Plug-ins.  The Eclipse Example Plug-ins are available on the same
download page as the Eclipse SDK.  Look for the section titled <strong>Example Plug-ins</strong>.
You can install the examples in the same location as you installed Eclipse or you can choose
a different location.  If you install the examples in the same location as Eclipse, the example views 
and editors will show up in your Eclipse environment (e.g. <strong>Windows &gt; Show View ... &gt; Other ... &gt; SWT Examples</strong>
If the SWT example views do not appear right away in your menu, restart eclipse with the <strong>-clean</strong> argument).
This is fine but it is not necessary.
<li>Select <strong>New &gt; Project ...</strong> from the <strong>File</strong> menu.
<li>Select <strong>Java Project</strong> and click on the <strong>Next</strong> button.</li>
<li>Give the java project a name such as "SWT Examples".</li>
<li>Select <strong>Create project from existing source</strong> and click on the <strong>Browse ...</strong> 
button to locate the following directory:
&nbsp;&nbsp;&nbsp;&nbsp;<code>eclipse/plugins/org.eclipse.sdk.examples.source_3.1.0/src/org.eclipse.swt.examples_3.1.0</code>
<li>Click on the <strong>Next</strong> button.</li>
<li>Click on the <strong>Projects</strong> tab and click on the <strong>Add</strong> button.</li>
<li>Place a check beside <strong>org.eclipse.swt</strong> and click on the <strong>OK</strong> button.</li>
<li>Click on the <strong>Finish</strong> button.</li>
</ol>

<p>At this point your SWT examples should be compiled without any errors.  Check the <strong>Problems</strong> 
view for errors.  If you get an error like "<code>java.lang.Object</code> not found" it means 
you have not configured a JRE.  Go to the <strong>Window</strong> &gt; <strong>Preferences ...</strong> dialog
and select the <strong>Java</strong> &gt; <strong>Installed JREs</strong> preference page.  Ensure that a JRE is installed 
and that the path to the JRE is correct.</p>

<h3><a NAME="Run"></a>Running the Example</h3>

<p>Now you can run the SWT standalone examples.

<ol>
<li>Open the Java perspective.
<li>In the Packages view, select the main class that you want to run.  
    For example, the main class for the Address Book example is 
    <code>org.eclipse.swt.examples.addressbook.AddressBook</code>.
<li>Select <strong>Run</strong> &gt; <strong>Run As...</strong> &gt; <strong>Java Application</strong> from the main menu.
</ol>


<h3><a name="ExamplesOverview">Examples Overview</a></h3>
<p>
Consult the documentation of each individual example for the name of
its main class and additional details.
The following examples are included in the <code>swtexamples.jar</code>:
</p>
<ul>
<li><a href="swt_addressbook_ex.html">Address Book</a>
<li><a href="swt_browser_ex.html">Browser Example</a>
<li><a href="swt_clipboard_ex.html">Clipboard</a>
<li><a href="swt_controls_ex.html">Controls</a>
<li><a href="swt_customcontrols_ex.html">Custom Controls</a>
<li><a href="swt_dnd_ex.html">Drag and Drop Example</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 Syntax Viewer</a>
<li><a href="swt_layout_ex.html">Layouts</a>
<li><a href="swt_paint_ex.html">Paint Example</a>
<li><a href="swt_texteditor_ex.html">Text Editor</a>
</ul>

</body>
</html>