views:

261

answers:

4

I have an ajax page which pulls data from a database. I'd like to add a processing applet to visualize the data but i can't figure out how to update the visualization as the data changes. The idea is to be able to push new data into the visualization.

I'm not tied to the processing technology, anything will work. Processing just seems to be the easiest way to make it look nice. Thanks for the advice.

A: 

You could make http requests from the java applet. I don't know anything about processing applets though.

Wouter Lievens
+2  A: 

I'm not sure of how you could facilitate communication between the two, but as a possible alternative you could look at processing.js, which is processing implemented in javascript.

Tom Haigh
+1  A: 

applets run in their own sandbox. Look at the java.net.URL and java.net.HttpURLConnection classes.

+3  A: 

The easiest way is to construct your own XML structure (base64 encode binary data if you need) and add a timer in your applet to retrieve updates from the server (through HTTP requests). How to prepare and process the XML is up to you.

Applets are a bit heavy-weight for visualization, so if the same thing can be done in Flash, I'd recommend using that instead. Flash also got support for HTTP requests (or you can let javascript handle it).

hishadow