This Java applet illustrates a three dimensional graphics example: a rotating wireframe cube. There are four classes that are used. Here is the source code for the classes:
  1. This class represents a point in three dimensional space: xyzpoint.java
  2. This class represents a line connecting two points in three dimensional space: xyzline.java
  3. This class represents a wireframe object as an array of xyzline objects: wirefr.java
  4. Display a rotating wireframe cube: cube.java

Click here to view the applet in motion
(adapted from Java Programming the Easy Way