wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Why I can't take the string from JTextField? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Why I can Watch "Why I can New topic
Author

Why I can't take the string from JTextField?

Richard Phen
Ranch Hand

Joined: Apr 27, 2002
Posts: 52
The code is showed below:

I type in some number and get a blank result: getSeatNumOnButnPan:
Why? Please help me solve it.


SCJP<br />SCJD
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937

protected JTextField seatTf = new JTextField(3);

That's because you used the wrong constructor for the filed. You probably meant:
protected JTextField seatTf = new JTextField("3");
JTextFiled(int value) means something else.
Eugene.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Why I can't take the string from JTextField?