不能运行啊
import javax.swing.*;import java.awt.*;
import javax.swing.event.*;
import java.awt.event.*;
public class Work3 extends JFrame implements ActionListener{
protected JButton btn;
protected JLabel lbl;
public Work3(){
setTitle("beautifule avril");
setSize(200,200);
//ImageIcon icon1 =new ImageIcon("D:/myjava/tupian.nba.gif");
// ImageIcon icon2 =new ImageIcon("D:/myjava/tupian.avril1.gif");
JLabel lbl =new JLabel("oh oh",JLabel.BOTTOM);
JButton btn =new JButton("avril");
//btn.setVerticalTextPosition(AbstractButton.BOTTOM);
Container cp;
cp=getContentPane();
cp.add(lbl);
cp.add(btn);
btn.addActionListener(this);
}
public void actionPerformed(ActionEvent e){
lbl.setText("hi my name is avril");
}
public static void main(String[] args){
Work3 work =new Work3();
work.show();
}
} 这个程序怎么编译通过了但不能运行