• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

retrieve the data from JTextField

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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! :)
 
My name is Inigo Montoya, you killed my father, prepare to read a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic