private intList sort () { if (size == 0) return new intList(); if (size == 1) create a new intList, append the only element to it, and return it. Construct left and right intList objects pick first element as pivot in list (referenced by head). loop through the rest of the elements, append all values smaller than pivot in the left intList and all values larger or equal in the right intList. left = left.sort(); right = right.sort(); append pivot and all elements in the right intList to the left intList. return the left intList.
The best approach to implementing this applet to create an intList object that would hold integer values and let the applet draw the lines. The idea is simple, you start with a default set of values, say 20 randomly chosen integers. Draw lines based on those values. Also, show those values at the bottom of the screen in a text area (I used the dump method from intList). When the user clicks on a Sort List button, your applet sorts the list and redraws the lines, also dumping the sorted list at the bottom. Each time user clicks on a New List button, a new set of values is generated that you again draw lines for and dump at the bottom. The Max Count is made to be changeable, but you can't allow too many lines,I think, I picked 80 as my max.
Checkout Tank Applet2 written by my independent study student David Fleming for some hints on user interfaces.