File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes clearing a text field for new text Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "clearing a text field for new text" Watch "clearing a text field for new text" New topic
Author

clearing a text field for new text

Davy Kelly
Ranch Hand

Joined: Jan 12, 2004
Posts: 384
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


How simple does it have to be???
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8997
    
    9



[How To Ask Questions On JavaRanch]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Moving this to the Swing / JFC / AWT forum...


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: clearing a text field for new text