Example Code from zetcode.com (needs SWT Framework)