• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Head First Java P346 - MiniMusic Apps - hanging and not returning to the command line

 
Ranch Hand
Posts: 239
2
jQuery Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A quick question, I think.

I am running the MiniMusicCmdApp class below - it compiles and almost functions as expected, except after it makes the sound the class hangs (blinking cursor - see image), and I have to close down Command Prompt, reset my path etc when I reopen it.

Is this a bad class, or is there something wrong with my computer settings?

Thanks

Marten




EDIT by mw: Added Code Tags.
[ February 24, 2007: Message edited by: marc weber ]
 
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure why it is hanging, but you can use cntl-c to force the program to shut down. Check the books website to see if there is a known problem in the code.

Sorry I couldn't be more helpful.
[ February 24, 2007: Message edited by: David McCombs ]
 
marten koomen
Ranch Hand
Posts: 239
2
jQuery Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

but you can use cntl-c to for the program to shut down



Thanks David, while it does not solve the problem, it does help a lot.

Marten
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
At the end of the try block (immediately after calling player.start();), try adding the following...

This will cause a 2-second pause (which should be long enough for the player to play the note you specified), after which it will close the Sequencer and exit the program.
[ February 25, 2007: Message edited by: marc weber ]
 
marten koomen
Ranch Hand
Posts: 239
2
jQuery Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Marc, this did the trick and I am one step further on the OO journey. Not sure why they did not include in the book... probably did not want to confuse the message...
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic