Forums Register Login

clearing a text field for new text

+Pie Number of slices to send: Send
Hey everyone,
I have a small problem, not that big, but i would like to get the correct solution.
I have passed this small test, but i want to make it better, for my own sake.
My problem is that I have a program that has a frame with a text field and 2 buttons Convert and Clear[B].
the program takes a string sentence, without digits or punctuation and only converts strings to morse code. The validation is fine and the conversion goes according to plan.
But when the [B]Clear
button is pressed, i would like the text field to clear of its contents and be ready for new output.
At the moment I just call the GUI constructor again, which is not what i want.
I have got the listners in and they are fine.
I looked at the API but could not find something to clear the text and have the field ready for new input.

Davy
+Pie Number of slices to send: Send
+Pie Number of slices to send: Send
Moving this to the Swing / JFC / AWT forum...
Well THAT's new! Comfort me, reliable tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 7106 times.
Similar Threads
[HELP]Trying to make a decision cmd adventure! How to branch decisions? NEED HELP AGAIN :S! NOT done
I'm stumped!
Using toArray(Object[]) in java 5
How to ceate a console window...
Performance when using objects in a loop
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 05:01:56.