Active Visual Scaffolding by Charles Kelemen and Eugene Turk

public class StudArr0 { static int size = 15; static int[] testArray = {9, 6, 3, 8, 15, 13, 24, 17, 2, 13, 11, 16, 90, 34, 22}; public static void main(String args[]) { int lowval, lowpoint, left, temp; ArrayGUI window = new ArrayGUI(); window.inAnApplet = false; window.setArraySize(size); window.setArray(testArray); window.initArray(); window.pack(); window.setVisible(true); for (left=0; left<size; left++) { lowpoint = left; lowval = testArray[left]; for (int i = left + 1; i < size; i++) { if (testArray[i] < testArray[lowpoint]) { lowval = testArray[i]; lowpoint = i; } window.redraw(); } temp = testArray[left]; testArray[left] = testArray[lowpoint]; testArray[lowpoint] = temp; window.redraw(); } } }

To pvwtalk10