一个很简单的程序:
Button one=new Button();
Button two=new Button();
为他们添加一个ActionListener;
在处理方法actionPerformed()中,要判断到底是哪个Button产生的事件:
actionPerformed(ActionEvent e)
{
    if(e.getSource==one)
        ...........;
    if(e.getSource==two)
        ...........;
}
以上没问题,我想e.getSource与one既然可比的话,那么肯定都是button类了,那我就改一下:
Button b=e.getSource;再拿b与one,two比较,可是这样就编译错误了:incompatible  
请高手帮帮我,我实在不明白。