Here is the output of the applet: 

Click anywhere inside the applet area to see the result....

and this is the code for it: DukeTest.java