📜  如何清除java代码示例中的文本字段

📅  最后修改于: 2022-03-11 14:52:48.239000             🧑  作者: Mango

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