Forums Register Login

retrieve the data from JTextField

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
The way to get data from a JTextField is via the getText() method.
+Pie Number of slices to send: Send
 

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=/
1
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
 

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! :)
Please enjoy this holographic presentation of our apocalyptic dilemma right after this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1361 times.
Similar Threads
Camera feed
Save data into textfile
Help help
reading data from Jtextfield on jpanel on jframe
String to integer??
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 03:49:59.