String s;
    if(t1!=null)    s=t1.getText();//exception在这
if( s!=null       ) t2.append(s);

解决方案 »

  1.   

    String s;
        s=(t1!=null? t1.getText():"");//exception在这
        t2.append(s);
      

  2.   

    JTextArea t1=new JTextArea(5,10);改为t1=new JTextArea(5,10);
      

  3.   

    同理还得把JTextArea t2=new JTextArea(5,10);改为t2=new JTextArea(5,10);
      

  4.   

    恩,ok了.十分感谢!!!刚学java不久,但我还是很用心的.^_^
      

  5.   

    thomas_20(执子之手,与子偕老)是正确的