テキスト領域のすべての行をStringBuilderに読み込んで、テキスト領域のテキストを文字列全体として使用できるようにします。ただし、行 s.append(line);でNullPointerExceptionが発生します。。なんで?
public class tu extends JFrame implements ActionListener{
    JTextArea t;
    static StringBuilder s;
    tu (){
        setLayout(/*new BorderLayout()*/null);
        t=new JTextArea(30,77);
        JScrollPane s=new JScrollPane(t,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
        JButton b=new JButton("process");
        b.addActionListener(this);
        JPanel p=new JPanel();
        JPanel p1=new JPanel();
        p.add(s);
        p.setBorder(new TitledBorder("sequence"));
        p.setBounds(0,0,880,540);
        p1.add(b);
        p1.setBounds(380,570,100,40);
        add(p);
        add(p1);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setSize(900,700);
        setVisible(true);
    }
     public void actionPerformed(ActionEvent e){
         String text=t.getText();
         while (text!=null){for (String line : text.split("\\n")){ 
         s.append(line);
         }}
     }
    public static void main(String[] args){
        tu t=new tu();
    }
}