When you put JTextField to your frame as you did in your code, it's placed at the top of the frame (north) and centered horizontally. Since you created text field of width 400 (characters) it's to wide so you're seeing just the middle part of it, and the beginning (where the text should appear) is hidden.
Put smaller value in the constructor of text field and you should be able to see it. If you want it to be as wide as the frame then change the layout of its parent panel (e.g. to GridBagLayout).
The quieter you are, the more you are able to hear.
Joined: Jun 09, 2003
the alignment problem is mainly caused by adding the textfield to a JPanel with default layout of FlowLayout, which will center the textfield in the panel.
get rid of the panel.
also, you may want to use this for a calculator
Joined: Apr 27, 2012
Looks like i underestimated (by a long way) the size of the textFIeld. Apparently 30 characters is the limit for my frame size.
It is all working now though, thanks.
EDIT: Michael your right, i don't really need that JPanel. I have adjusted it now and the right alignment makes it looks a lot better as well