不知道你要想做什么?试试这个
JButton jb = (JButton)e.getSource();
jb.setBackground(Color.BLACK);

解决方案 »

  1.   

    class play extends AbstractAction{     
          public void actionPerformed(ActionEvent e){
             JButton jb = (JButton)e.getSource();
             jb.setBackground(Color.BLACK);          }
      }
      

  2.   

    Integer temp=new Integer(s);
    int temp1=temp.intValue();
    改为下面再试试。
    Integer temp1=new Integer.valueOf(s);
      

  3.   

    在Integer这里应该没有问题
    毛病应该是出在按钮数组的定义上了
    但是我想这么定义
    不知道如何解决
      

  4.   

    int temp = Integer.parseInt(s);
    试试我建议把这句
    flock[i][j].setActionCommand(""+i+j);
    的(""+i+j)输出看看是怎样。在判断定义是否有问题。