refresh - clean JtextArea -java

0

I have a query: What would be the way to refresh (not duplicate / accumulate) the text of a JtextArea by pressing a button? - For example, pressing the "View Result" button several times, the information is added or duplicated in the textArea.  - in the same way if I do it from a JComboBox, when I change the item, it shows me information in the textarea but it does not eliminate the information of the previous selected item or by alternating between the JcomboBox options. Thanks for the help.

    
asked by Jr Mezaq 05.07.2018 в 20:57
source

1 answer

0

There is a method that has each JTextField which is called setText (). with this method you can set the current information in the TextField, an example of this would be:

JTexfield1.setText("");

So that the data or the results are not acomulen you would have to set them at the beginning of each function or what is to say place the setText with empty quotes

    
answered by 05.07.2018 / 21:16
source