求帮忙看下为什么这个程序中按钮不响应事件!
import java.awt.*;
import javax.swing.*;
import java.awt.event.*; //做的事一个简单的计算器程序,有计算器的界面
//但是还没有完全实现功能的时候就发现给按钮添加了事件响应但按按钮的时候去没有反应,请帮忙看下吧。
public class window {
JFrame aq;
JPanel all;
JPanel al2;
int shu1=0;
int shu2=0;
String res="0",jj="0";
JButton a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16; //16个计算器按钮
JTextField t1;
public static void main(String args[])
{
window ll=new window(); //驱动程序
ll.go();
}
public void go()
{
ActionListener ajj=new ActionListener() { //添加事件响应
@Override
public void actionPerformed(ActionEvent e) {
String rn=e.getActionCommand();
if(rn=="0") //如果按下零号键,则讲文本框里的文字设置为SASAG
//可是点击零号键却没有反应
{
res=(shu1+shu2)+"";
shu2=0;
jj=shu2+"";
t1.setText("sasaga");
}
else if(rn=="1")
{
shu1=shu2;
shu2=1;
jj=shu2+"";
t1.setText(jj);
}
else if(rn=="2")
{
shu1=shu2;
shu2=2;
}
else if(rn=="3")
{
shu1=shu2;
shu2=3;
}
else if(rn=="4")
{
shu1=shu2;
shu2=4;
}
else if(rn=="5")
{
shu1=shu2;
shu2=5;
}
else if(rn=="6")
{
shu1=shu2;
shu2=6;}
else if(rn=="7")
{
shu1=shu2;
shu2=7;
}
else if(rn=="8")
{
shu1=shu2;
shu2=8;
}
else if(rn=="9")
{
shu1=shu2;
shu2=9;
}
else if(rn=="+")
{
res=(shu1+shu2)+"";
shu1=shu1+shu2;
t1.setText(res);
}
else if(rn=="-")
{}
else if(rn=="*")
{}
else if(rn=="/")
{}
else if(rn==".")
{}
else
{}
}
};
JPanel all=new JPanel();
JPanel al2=new JPanel();
JTextField t1=new JTextField("0",30);
JFrame aq=new JFrame("ssss");
a1=new JButton("0");
a2=new JButton("1");
a3=new JButton("2");
a4=new JButton("3");
a5=new JButton("4");
a6=new JButton("5");
a7=new JButton("6");
a8=new JButton("7");
a9=new JButton("8");
a10=new JButton("9");
a11=new JButton("+");
a12=new JButton("-");
a13=new JButton("*");
a14=new JButton("/");
a15=new JButton(".");
a16=new JButton("=");
Container af=aq.getContentPane();
af.setLayout(new GridLayout(2,1));
all.add(t1);
al2.setLayout(new GridLayout(4,4));
al2.add(a8);
al2.add(a9);