• Post Reply Bookmark Topic Watch Topic
  • New Topic

retrieve the data from JTextField  RSS feed

 
Bobby Marvikuan
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to retrieve the data from JTextField? for example I have a JTextField and it is editable, so, I want to get that date the user put in. I tried to use method JTextField.getText(); but eclipse makes it red saying that I need to declare my JTextField as a final variable. Or should I use BufferReader? Any advice? Cheers
 
Paul Clapham
Sheriff
Posts: 22831
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The way to get data from a JTextField is via the getText() method.
 
Bobby Marvikuan
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:The way to get data from a JTextField is via the getText() method.

Thanks for answering but that is weird why my eclipse is going mad about this sentence=/
 
Paul Clapham
Sheriff
Posts: 22831
43
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not "weird" at all. Error messages are a perfectly normal part of programming. So it's better to deal with them when you see them; you can't wish them away by trying to imply that they are an anomaly.

In other words: You've got an error message. Nothing unusual about that. So fix your code so it doesn't contain that error any more. You even got a suggestion about how to fix it, but for some reason you have disregarded it and settled on something completely unrelated as the source of the problem.
 
Bobby Marvikuan
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:It's not "weird" at all. Error messages are a perfectly normal part of programming. So it's better to deal with them when you see them; you can't wish them away by trying to imply that they are an anomaly.

In other words: You've got an error message. Nothing unusual about that. So fix your code so it doesn't contain that error any more. You even got a suggestion about how to fix it, but for some reason you have disregarded it and settled on something completely unrelated as the source of the problem.

Cheers! :)
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!