• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Java Newbie Problem - streaming

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All - I have a desktop application that needs to respond to user input at all times. But, it also connects to an internet device where it needs to receive streaming audio. The problem I am having is how to code the program so it will respond to user commands via the gui at any time, but still receive the streaming audio from the internet device at the same time. I tried putting the streaming audio reception in a separate thread, but that doesn't work. The program either runs one thread or the other and since the streaming audio is continuous, it never goes back to the gui thread.

Any ideas welcomed and thanks!
 
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Multiple threads is exactly what you need. The problem is likely how you are launching the thread. Or in the thread implementation. To properly help you though, we would need to know more information about your code and its design. Can you tell us a bit more and post some of the relevant code?

Also, have you read the Sun Java Tutorial's Concurrency in Swing lesson? It explains some important concepts on multi-threading in a swing application.
 
Marshal
Posts: 74004
332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds too complicated a question for beginners'. Moving.
 
wayne whitman
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Mark. See, it really was a newbie question as this is my first Java program and I was not aware of that tutorial.
Should be able to solve it from here.
 
I would challenge you to a battle of wits, but I see you are unarmed - shakespear. Unarmed tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic