Check out example codes for "how to clear text fields in java". It will help you in understanding the concepts better.

Code Example 1

JButton b = new JButton("Clear");
b.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e){
        textfield.setText("");
        //textfield.setText(null); //or use this
    }
});

Learn ReactJs, React Native from akashmittal.com