SWT Win32 Extension 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 a SWT Win32 Extension 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, you should create a new Java project that depends on SWT and SWT win32 Extension, copy the desired snippet to the clipboard, and paste it into a new snippet class. Run by selecting the class and then selecting Run > Run As > Java Application. Then the console will tell you an UnsatisfiedLinkError, you should set the SWT and SWT Win32 Extension's dlls file dir on the Djava.library.path like as "java -cp swt.jar;swt-extension.jar -Djava.library.path=./dll example".

To contribute a new snippet, please send it to my mailbox . Thanks in advance for your contribution!