void jButton1_actionPerformed(ActionEvent e) {
    try{
      StringBuffer sb = new StringBuffer();
      int n = jTextArea1.getLineCount();
      Action[] action = new Action[n];
      for (int i = 0; i < n; i++) {
        int start = jTextArea1.getLineStartOffset(i);
        int end = jTextArea1.getLineEndOffset(i);
        String line;
        if( i == n - 1 ){
          line = jTextArea1.getText(start, end - start);
        }else{
          line = jTextArea1.getText(start, end - start - 1);
        }

        sb.append(line);
        sb.append(",");
      }
//      agent.setCommands( sb.toString() );
    }catch( Exception x ){ x.printStackTrace(); }
  }