急急急!来个JAVA高手给看看程序,图形用户界面的

来源:百度知道 编辑:UC知道 时间:2024/05/14 03:07:11
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Ex9 extends JApplet{
public void init()
{
Container contentPane=getContentPane();

contentPane.setLayout(new GridLayout(2,1));
JButton button=new JButton("Click me");
final JLabel label=new JLabel();
contentPane.add(button);
contentPane.add(lable);
button.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
String information=JOptionPane.showInputDialog("input ");
lable.setText(information);
}
}
);
}
}
这个例题,我用JDK1.5.0怎么编译不过去,高手说说,你可以编译试试,能编译就告诉我,我出现两个错误如下:

E:\cc>javac Ex9.java
Ex9.java:13: cannot find symbol
symbol : variable lable
location: class Ex9

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Ex9 extends JApplet{
public void init()
{
Container contentPane=getContentPane();

contentPane.setLayout(new GridLayout(2,1));
JButton button=new JButton("Click me");
final JLabel label=new JLabel();
contentPane.add(button);
contentPane.add(label);
button.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
String information=JOptionPane.showInputDialog("input ");
label.setText(information);
}
}
);
}
}
你没看提示哦 呵呵 label写错了