Hi,
A data acquisition program in Java, neat!!!
If you have subclassed AbstractGraphModel then fireGraphDataChanged()
is the correct method to use. (Note it has been renamed from
fireDataChanged() in recent versions). If you are using one of the
DefaultGraphModels then you should not be using fireGraphDataChanged()
at all, but a changeSeries() method. Further, fireGraphDataChanged()
should only be called from within the event-dispatching loop (see Java
tutorial). If you are calling it from another thread, you should be
using something like
SwingUtilities.invokeLater(new Runnable() {
public void run() {fireGraphDataChanged();}
});
or
EventQueue.invokeLater(new Runnable() {
public void run() {fireGraphDataChanged();}
});
see also invokeAndWait().
I hope this resolves your problem.
Regards,
Mark
--- In
jsci@yahoogroups.com, bleu_c <no_reply@y...> wrote:
> Hi, I'm a using this nice Jsci api to create line graphs for my
> school project, which really saves me the trouble of reinventing the
> wheel.
>
> I'm acquiring data from the serial port RS-232, using the serial
> communication api from java.sun.com, then plot them on 2 line graphs.
> Everything works fine on my computer at home, but not on the laptop
> computer at school. This laptop has WindowsME, running the Sun One
> Studio 4 update 1 Community Edition.
>
> And so, I keep getting problems with the function fireDataChanged
> during compilation, and even when I try to run the class files of my
> program compiled from my CPU at home. If I don't call fireDataChanged
> at all, everything compiles and runs smoothly, except now the line
> graph won't refresh... :(
>
> So I'm searching for another way to refresh line graphs without
> fireDataChanged. If any of you guys have some ideas, or have seen
> similar problem, plz let me know, I really apreciate it.
>
> Thanks for your time, and good day to you all!