previous | start | next

Selection Sort Algorithm Animation: paintComponent

paintComponent calls the draw method of the algorithm object:
public class SelectionSortComponent extends JComponent
{
   public void paintComponent(Graphics g)
   {
      if (sorter == null) return;
         Graphics2D g2 = (Graphics2D) g;
      sorter.draw(g2);
   }
   . . .
   private SelectionSorter sorter;
}

previous | start | next