Eclipse

SWT Snippets

Snippets are minimal stand-alone programs that demonstrate specific techniques or functionality. Often a small example is the easiest way to understand how to use a particular feature.

Snippets also help isolate problems. The best way to report an SWT bug is to write your own snippet showing the problem and paste it into the bug report. For a snippet template, see the "Hello World" example.

Note that the examples here are often edited for brevity rather than completeness. They are intended to guide the reader towards the correct solution, rather than be finished products. These snippets are tested against the HEAD stream and may sometimes reference new API or require bug fixes from there.

To run a snippet, simply set up SWT in your Eclipse workspace, create new Java project that depends on SWT, and paste the example into a new Java class. More detailed instructions are available.

Click the z logo to load the J2S SWT snippet.
And For IE users, the position of the inner Window/Dialog/Shell is not correctly calculated. You may have to scroll up and down to find the windows.

Not all the snippets is supported!
Enjoy finding out which J2S SWT Snippets work. J2S SWT is still under developing.

Snippets for Pocket PC

J2S Console: