John Smith John Smith - 1 year ago 75
Java Question

How to blank JTextfield after input

I am writing a program and I want the JTextfield to be blank after the input has been given.

For example; user inputs a number, he presses the add button and the textfield should be blank again and should not contain the number. I tried using

but it doesnt work. If you need the code tell me, I will edit it.

Answer Source

you can just do textfieldname.setText("");

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download