A frame is the window for you application. It holds all componentsfor your application. A canvas is a component, same as a TextFieldor CheckBox is. If you where developing a paint program you might use a to trap the user's inputs and draw the objects (lines, circles, boxes, etc.) that a user requests. To display the Canvas you would put it in a Frame.

From your question, I am guessing you are just aboutto develop your first GUI app in java. if so, I would suggest a few things:

You most likely do not need a Canvas class.

You will almost certainly need to have a Frame. Thisis the object you will put all your Components (text fields, buttons, dropdowns, lists, etc.) into and display them. It is also the component that draws your window tilte and decorations (resizing, iconify, maximize,etc). for you.

Generally you should prefer to use Swing over AWT unless you have agood reason not to. Swing can be much more efficient andthere is a Swing component for each AWT component. For example use a JFrame instead of a Frame and a JCanvas where you would usea Canvas). But be wary of using both Swing and AWT components in thesame app.