我有一个简单的显示例程
public static void showEngineAnalysis(String message) {
if (message.length() > 0)
message += "\n";
Application.obj.engineOutput.append(message);
}
从下面的输入流中打印数据
public void getEngineOutputOriginal(Process engine)
{
try {
BufferedReader reader =
new BufferedReader(new InputStreamReader(engine.getInputStream()), 1);
String lineRead = null;
while((lineRead = reader.readLine()) != null)
Application.showEngineAnalysis(lineRead);//send engine analysis to print method
}
catch(Exception e) {
e.printStackTrace();
}
}
我希望显示例程在我的 JTextArea (engineOutput) 顶部而不是底部打印下一行,即来自:
- e7e6 b1c3 2. c5d4 e3d4
- e7e6 c4d5 2. e6d5
- c5d4 e3d4 2. b8c6
至
- c5d4 e3d4 2. b8c6
- e7e6 c4d5 2. e6d5
- e7e6 b1c3 2. c5d4 e3d4
我完全想不通(我试过插入符号位置等)