Sample Code from Java Examples in a Nutshell:
Link to 3D Canvas developed by David Eberle and M. Pilant

Tips for speeding up your code