Originally posted by Pankaj Halder: When should they be used, respectively? They seem very similar to me.
java.awt.Panel implements the Container interface, java.awt.Canvas does not but it does clear the background before painting itself.
It used to be (more than a decade ago, before the release of JDK 1.1) that to create a completely new Component one had to extend either Canvas or Panel, both heavyweight classes. Starting with JDK1.1 it was possible to extend java.awt.Component (or java.awt.Container) directly. Since then there hasn't been much use for Canvas.