JFreeChart does not show the graph at every iteration on thread?

后端 未结 2 1407
执念已碎
执念已碎 2021-01-28 13:12

I am getting counter values in one class using a thread and writing JFreeChart in another thread. While executing, it works alternatively, but only shows the graph

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-28 13:33

    Don't sleep on the event dispatch thread (EDT). As shown in Concurrency in Swing, use a worker thread to update the dataset on the EDT in process(). A complete example is shown here.

提交回复
热议问题