开发者

Real-time bar chart in a Java applet

I want to display data and watch the bars move as the data comes in. Is there a way to do this with a java applet?

(I'm not married to 开发者_开发百科the idea of an applet)


You could use JFreeChart. It has a ChartPanel, which is a Swing component that can be added to an applet. If you update the DataSets of the charts the panel will automatically update. You will just somehow have to retrieve the data from the server as it comes in. It should be possible to use a HTTP connection to the web server and read it line by line and parse it for data that you add to the chart data. You will probably need some kind of queue in the server that receives data from a process that generates new data and writes it to the HTTP stream.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜