1
以下是我的java代码:如何将控制台输出打印到JTextArea?
有人可以请建议如何打印相同的JTextArea
?
DBCursor cursor = coll.find();
int i=1;
while (cursor.hasNext())
{
System.out.println("Inserted Document: "+i);
System.out.println(cursor.next()); // i want to print this into jtextarea
i++;
}
我想用[这个答案]关闭此问题(http://stackoverflow.com/questions/12945537/how-to-set-output-stream-to-textarea/12945678#12945678),但那可能会因为你的需要而有点过度杀人 – MadProgrammer