Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to clear text fields in java

JButton b = new JButton("Clear");
b.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e){
        textfield.setText("");
        //textfield.setText(null); //or use this
    }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #clear #text #fields #java
ADD COMMENT
Topic
Name
8+4 =