java - Is multithreading possible in Jfreechart? -


I want to create a dataset for my chart, which will be updated once. But I'm using ssh commands to get the data, for example, when I call Sir-NAD1 1 on a remote machine, then after 3 seconds the responses will be 5- I'm calling 6 commands this way, so it takes a lot of time to update my chart. So I need to send these commands to threads, so I can wait less than before. I am not a professional in threading in Java.

Here's an example code:

  Public Migrate () // My Constructor Function, it keeps some components for me. {// some code timer = new timer (Fast, New Action Listener) {@ Override Public Wide Action Critical (Action Event E) {Time for Priority Period = New Seconds (); For (Int J = 0; J & LT ; Param La Lam; J ++) {String Sonak = PRS.PERS1 (SES Connection, "Sir- NAD1 1 | Grapp-VF" + Sutton + "| Agak '{Print $"} + Ultimate [J] + "}" Tail-1 "); String Suite = PRS.PERS1 (SES Connection," Sir-ND1 1Grape IFAAC | Tail-1 | AZC ' T $ "+ ultimate [ja] +"} '"); // I need to bring these" sonak "and" satun "variables up / along as well, because each command will execute 2-3 / second Takes 2-3 seconds in dataset.ed (duration, double, PRDAWL, sonu), if (dataset.getitimcount () & gt; COUNT) {timedeparrias ii altitude = dataset.gate time period (0); dataset. (First item time, sutton);}}}}); // some code}  

JFreeChart No thread is safe . Just like any other AWT / swing component, any update of the JFree chart should be done on EDT.

As it is said, you (and possibly he) can keep your loading on a different thread, and only your updated chart (on EDT) after you Loaded entire dataset.


Comments