This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin Cookbook and have Ken Kousen on-line!
See this thread for details.
Win a copy of Kotlin Cookbook this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

How to build ticker tape?

 
Ranch Hand
Posts: 202
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My FX project has many tabs and I need to build into one of the tabs a ticker tape from a feed.
It needs to be updated periodically with live data.
Assume it is a live feed, but nowhere near as volatile as the stock exchange.

QUESTIONS:
1) Do I need another thread for the ticker just so it won't impact on the rest of the work the user is doing? Where best to read up on multi-threaded apps?
2) Should I capture the data from the feed and insert them into cloud, then query the cloud and download the data?
3) I need to capture the live data to find out the daily max, min and volume, should I use a scratchpad-table, then summarize to a warehouse type table at end of day and delete all entries in the scratchpad-table?
4) Can I capture the data in a device-to-device feed i.e. from the ticker-source directly to my app? If so, please point me to some documentation, samples, anything...

Informed hi-level guidance very much appreciated.

P.S. I have designed the app to scroll data across the screen at any speed I want with hard coded test data, but not certain how best to proceed with live data.
P.P.S. Come to think of it, I might have multiple feeds and threrefore multiple tickers, definitely multi-threaded app, do I need call-back so as not to impact of any running thread.
 
Saloon Keeper
Posts: 11017
243
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

AhFai Chan wrote::1) Do I need another thread for the ticker just so it won't impact on the rest of the work the user is doing?


It depends on how you're getting the live data. For a little amount of data, you may occasionally poll the source of the data directly from the UI thread. For lots of data you might need to process it in a background thread before you update the ticker.

Displaying the ticker itself (and scrolling its content) must always be done on the UI thread. I'm not really familiar with JavaFX, but you can probably do this with a TranslateTransition.

Where best to read up on multi-threaded apps?


Probably in the JavaFX Concurrency trail: https://docs.oracle.com/javase/8/javafx/interoperability-tutorial/concurrency.htm

2) Should I capture the data from the feed and insert them into cloud, then query the cloud and download the data?


What does 'the cloud' mean to you and what does it have to do with any of this?

3) I need to capture the live data to find out the daily max, min and volume, should I use a scratchpad-table, then summarize to a warehouse type table at end of day and delete all entries in the scratchpad-table?


Slow down! What does it matter? More important is who is responsible for finding out the daily max? The service you're consuming? Your client application? A service you've built in between?

4) Can I capture the data in a device-to-device feed i.e. from the ticker-source directly to my app? If so, please point me to some documentation, samples, anything...


How can we do this if we don't even know what service you're consuming?

Come to think of it, I might have multiple feeds and threrefore multiple tickers, definitely multi-threaded app, do I need call-back so as not to impact of any running thread.


I don't see how you're making the jump from multiple feeds to multiple threads. You can consume multiple services just fine from a single thread.
 
AhFai Chan
Ranch Hand
Posts: 202
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have really given me something to think about.
I can handle the codes, but sometimes, I find the GUI design quite challenging and I have to go back and re-design the layout and flow b/c at a point downstream there's some roadblocks that I could have avoided, like right now, if only I were prescient.
I don't know about the others, but to design the GUI for a complex application system, those Oracle tutorials and most books are just not enough.
That's why I ask for hi-level stuff. I think a 2nd thread is the save way to approach this.
Thanks.
 
Opportunity is missed by most people because it is dressed in overalls and looks like work - Edison. Tiny ad:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!