This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why I can't take the string from JTextField?

 
Richard Phen
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code is showed below:

I type in some number and get a blank result: getSeatNumOnButnPan:
Why? Please help me solve it.
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic