Hello i made a program in wich i display the signal of a preasure sensor with an arduino.When i run my program in the console it apearse an error but the program is still running and i can see the the signal.I know that many people asked about this error.(sorry that i put the same question). I've read some post's but i can't resolve it.i''ve posted the error and the code down.
THANK YOU VERY MUCH IN ADVANCE!
Exception in thread "AWT-EventQueue-0" ERROR
-
- Posts: 20
- Joined: Fri Jul 24, 2015 2:20 pm
- antibot: No, of course not.
Exception in thread "AWT-EventQueue-0" ERROR
Last edited by hassan.elkhatib on Mon Aug 24, 2015 1:09 pm, edited 1 time in total.
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Exception in thread "AWT-EventQueue-0" ERROR
The problem is that the chart is being repainted in the UI thread, but while that is happening your background thread is modifying the data series. JFreeChart isn't thread safe, so you need to ensure that while the chart is being drawn no other threads update the dataset that is being rendered. When your chart is part of a Swing GUI (that is, you are using ChartPanel) you should ensure that dataset updates are also made on the UI thread (using SwingUtilities.invokeLater).
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
-
- Posts: 20
- Joined: Fri Jul 24, 2015 2:20 pm
- antibot: No, of course not.
Re: Exception in thread "AWT-EventQueue-0" ERROR
When i put the "SwingUtilities.invokeLater(thread);" after "window.repaint();" it's saying that "the local variable thread may not be initialized" and when i put it before "thread.start();" i don't have errors but the signal is not displaying more.
-
- Posts: 513
- Joined: Wed Sep 12, 2007 3:18 pm