Small examples for the usage of SWT.
To compile this project, you need to set the classpath specific for your operating and windowing system. For this, rename one of the following files to
To see these files, you may have to remove the filter for “.* resources”:
Shell#setText(title)) even if it's only a generic “Snippet <number>”.
System.exit(). This can interfere the operation of SnippetLauncher or SnippetExplorer.
new Display()to create the display and not create
Shellin a static initializer. This can interfere the operation of SnippetExplorer and sometimes SnippetLauncher. Especially the SnippetExplorer can run Snippets multiple times without reloading the Snippet class. A static initialized shell is disposed after the first run and might not reinitialized on following launches.
setDaemon(true)is stopped immediately when the Snippet ends. At best a Snippet stops all threads on exit.