JFreeChart EDT Issues?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Post Reply
dunabur
Posts: 19
Joined: Sat Jun 24, 2017 12:05 pm
antibot: No, of course not.

JFreeChart EDT Issues?

Post by dunabur » Wed Oct 30, 2019 3:25 pm

Hey everyone,

I have a problem with a swing application that uses live charts from jFreeChart. I am not sure if jFreeChart is the cause, to be honest, but I have looked everywhere else and did not find the problem so far.

I am getting graphical glitches in my application, just like you would expect from not using the EDT. Parts of the chart (using candlestickRenderer) get painted on a JComboBox dropdown for example, wenn it is open.
I have already tried to find out if my application has some calls to the GUI that are not from the EDT, and I have found none. To be sure that I didn't miss any, I used ThreadCheckingRepaintManager (http://www.jidesoft.com/javadoc/com/jid ... nager.html). But there I get no errors as well, no calls to the gui from other threads then the EDT. To make sure that this class works, I called the GUI from a normal thread, which instantly gave me errors - so ThreadCheckingRepaintManager should work. So I am confident that I did not create any GUI updates with jFreeChart that do not use the EDT.
The problem is difficult to replicate. What seems often to be the case though, is that if my mouse hovers over the chart prior to accessing the dropdown, that the problems begin. I cannot be 100% certain though. I have also looked into other issues such as overriding paint() or paintComponent(), but I do not do this, as well as issues with opaque, which I do not use neither. I also have reinstalled java, but the problems remain. When using other jInternalFrames in the same application, that do not have jFreeChart code in them, there are no glitches. They begin once I use a internal window with a chart in it. The glitch seems to be more reproducible if I enable a crosshair on the chart. Which would mean more chartMouseMoved Events.

I am really lost on how to debug this. Maybe someone has some tips for me on how to debug visual glitches in swing, maybe from jFreeChart, that are not caused by not using the EDT?

Thank you so much for any help.

John Matthews
Posts: 484
Joined: Wed Sep 12, 2007 3:18 pm

Re: JFreeChart EDT Issues?

Post by John Matthews » Wed Oct 30, 2019 10:44 pm

ThreadCheckingRepaintManager can be very helpful, but it may not be dispositive. Other problems may exist. It's hard to say without a complete example and relevant version details. This example may provide a useful reference point from which to start trying to reproduce the effect you're seeing.

dunabur
Posts: 19
Joined: Sat Jun 24, 2017 12:05 pm
antibot: No, of course not.

Re: JFreeChart EDT Issues?

Post by dunabur » Tue Nov 05, 2019 9:25 pm

Hey there,

I found the error. It seems that the 3d3 driver is buggy (geforce 1080 TI with latest drivers). Switching to opengl solved the problem.

Are you by any chance the user trashgod on stackoverflow? This post (https://stackoverflow.com/questions/343 ... l-ghosting) from you helped me getting to the root of the problem.

Because "thank you" posts are not appropriate on stackoverflow, let me tell you here that you have no idea how often your post have helped me in the past. Thank you so much for the work you put into helping others. I really appreciate it.

Post Reply