Plot4j is a Java library that permits to draw two-variables diagrams in a Cartesian plan. The diagrams can be exported as images or visualized on Java Swing panels.
You need just a few lines of code to draw a diagram. The first thing to do is specify the graph/s to visualize on the diagram. Then, a Diagram object must be created. Then, a Diagram object must be created.
Besides being exported in an image, the Diagram can be visualized on a Java Swing panel. All you have to do next is create a DiagramPanel object.
Now, the DiagramPanel can be added to a Java Swing container, such as a JPanel.
If in your desktop application you want to show real-time data, and your graphs must refresh every n seconds, let's say 2 seconds, you can set a refresh interval to your DiagramPanel.
In this way, the DiagramPanel will read the data every 2 seconds, refreshing the diagram on the screen.