• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Dynamic Plotting in JAVA

wantedSpidy

Senior member
Hey guys,

I have another question for all your smart AT'ers.

OK so I have aan application which currently performs some operations on files and plots them and creates some other visualizations.

I need to make my application more dynamic, in the sense, I want to be able to update my input file and then see the change in the graphs I'm outputting. Eventually I will change it to some sort of stream, once my research group finalizes on the nitty-gritty details of the project. But for now, do you guys have suggestions on how to do this?

An example:
Input
time, value
1, 100.2
2, 100.5
3, 100.6

Output: Time on X axis and the value on Y axis.

Then *while* my applications is already running, I want to be able to append
4, 100.8
5, 100.8

and then have my graph plot those additional points as well!!

Is it possible? Any nice packages out there?

Sorry for so many questions!! I'm more of a C programmer, all this Java GUI programming is new to me 😀

Thanks
 
I don't believe there is a way in java to listen for file changes.

First thing that comes to my mind is to setup a timer and check for modification to the file periodically.

I'm guessing you're creating a File object to read the file. There is lastModified() property you can use to see if the file has changed since the last time it checked.
 
Originally posted by: Onund
I don't believe there is a way in java to listen for file changes.

First thing that comes to my mind is to setup a timer and check for modification to the file periodically.

I'm guessing you're creating a File object to read the file. There is lastModified() property you can use to see if the file has changed since the last time it checked.

Yeah, your best bet would be to poll the File's lastModified()....
 
Back
Top