1

クライアント プログラムから取得した文字列を追加しようとしています。ただし、append ステートメントが while ループになるようにしました。これはリアルタイムで動作しないことに影響しますか?

のような地域の場合

   tfFIXMsg.append( inputLine + "\n\n\n");

       tfCSVLine.append(outputLine+"\n\n\n");

while ループが完了するまで、textArea にメッセージは表示されません。クライアントからメッセージを受信し続け、リアルタイムで textArea に出力できるようにするにはどうすればよいですか

try {
    while ((inputLine = in.readLine()) != null) 
          { 
           System.out.println ("Server: " + inputLine); 


           tfFIXMsg.append( inputLine + "\n\n\n");


           int pos = inputLine.indexOf(inputLine, 0);
           h.addHighlight(50, 60, DefaultHighlighter.DefaultPainter);



           if (inputLine.trim().equals("Bye.")) {
               System.out.println("Exit program"); 
               break;
               } 

           Scanner input1 = new Scanner(new File(csvName));
           Scanner input2 = new Scanner(new File(csvName));
           Scanner input3 = new Scanner(new File(csvName));
           Scanner input4 = new Scanner(new File(csvName));


           String csvline = getCsvLineVal (getLocation34CSV(getTag34Value(Tag34Location(getTagCSV( parseFixMsg(inputLine ,inputLine))), getValueCSV( parseFixMsg(inputLine ,inputLine))), getVal34(input1,  input2)), getCSVLine( input3,  input4) );
           outputLine = compareClientFixCSV( getTagCSV( parseFixMsg(inputLine ,inputLine)), getValueCSV(parseFixMsg(inputLine ,inputLine)), getCSVTag(csvline), getCSVValue(csvline));

           out.println(outputLine);
           tfCSVLine.append(outputLine+"\n\n\n");

           input1.close();
           input2.close();
           input3.close();
           input4.close();



          }
} catch (FileNotFoundException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}
4

2 に答える 2