i have getting errors when i try to compile this code relating to ACTIONLISTENER . i use JDK1.3
import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; class temp extends Frame { Button b1,b2; Label l1,l2; TextField t1,t2; public temp (String t) { super(t); b1=new Button("CONVERT"); b2=new Button("CANCEL"); l2=new Label("TEMPRETURE IN C"); l1=new Label("TEMPRETURE IN F"); t1=new TextField("20"); t2=new TextField("20"); setLayout (new FlowLayout()); add(l1); add(t1); add(l2); add(t2); add(b1); add(b2); t2.setEditable(false); setSize(500,500); setVisible (true); b1.addActionListener(this); b2.addActionListener(this); } public void actionPerformed(ActionEvent e) { if(e.getSource()==b1) { float a=Float.parseFloat(t1.getText()); float b; b=(9/5*(a+32)); t2.setEditable(true); t2.setText (String.valueOf(b)); t2.setEditable(false); show(); } if(e.getSource()==b2) { System.exit (0); } } }