Please give some code snippets. Normally you would use a JFrame as your window and add up your elements eventually using some kind of LayoutManager.
edit after codesippet appeared:
You have 3 main problems that I can figure out from this snippet.
- Why do you set the layout of the frame to null? Just take the standard.
- You are missing frame.pack() before the frame.setVisible(true) this would pack all the Elements (e.g. the Textfield) according to the used layout
- You centralize all your code to one class (this) it is your Canvas, and also key-,action-, and mouse listener. You should put them in different classes or at least make a Listener Class that handles all the logic.