• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Newbie Problem - streaming

 
wayne whitman
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • 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!
 
Mark Vedder
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • 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.
 
Campbell Ritchie
Sheriff
Posts: 48370
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds too complicated a question for beginners'. Moving.
 
wayne whitman
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic