Frage

I am reading data continuously from a sensor and want to plot chart using that data. I already create that chart, however, system draws that chart for only the first reading, doesn't change the plot dynamically.

I used paintComponent() and I try to update that by using repaint. I have found that though data updates continuously, but the program doesn't execute paintComponent() for more than one time.

any suggestion to solve that problem would be highly appreciated.

War es hilfreich?

Lösung

Try

validate() or revalidate()

and then,

call repaint()

Hope this will help.

Helpful Link : http://docs.oracle.com/javase/6/docs/api/javax/swing/JComponent.html#revalidate()

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top