Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is it feasible to use Jtable for displaying Streaming Content?

 
Preeethi Jainnn
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a requirement where i need to display Streaming Data like Bid , Ask , Last , Change values for the Stock Quote Symbols recievied from a third party server in a Grid .

For this can i use a Jtable as the Data would be chnaging continously ??

Please share your views , thanks in advance

 
Rob Spoor
Sheriff
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can, but you need to take into account Concurrency in Swing. In other words, reading the stream should be done in a background thread and the updates on the Event Dispatcher Thread. A SwingWorker could help out here, with doInBackground doing the hard work, calling publish as needed. You can then override process to insert data into the table.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic