import javax.swing.*; import java.awt.*; import java.awt.event.*; class a extends JFrame{
JTextField t=new JTextField ("bgfvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv"); JButton b1=new JButton("null"); JLabel l=new JLabel("write");
a(){ Container c=getContentPane(); c.setLayout(new FlowLayout()); c.add(l); c.add(t); c.add(b1);
but x=new but();
b1.addActionListener(x);
setSize(100,360);
setVisible(true);
}
public static void main (String[]args){ new a(); }
class but implements ActionListener{
public void actionPerformed(ActionEvent z) { t.setText("");
}}}