I am trying to use the code from the head first java 2nd edition book, page 342, and i am using eclipse ide with jre 1.6.0 it's giving me syntax errors when I declare Sequencer player = MidiSystem.getSequencer(); and it tells me "The import javax.sound.midi is never used" how can I get this to work? this is very frustrating and I cannot find anything about this through google or searching the forums. I have been looking at both for a half hour now... Thanks for the help
It's complaining about an import statement. I'm sure that's just a warning. Maybe you have:
when you meant
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Joined: Jul 11, 2006
actually, I have typed in "import javax.sound.midi.*;" now for some reason I don't have that warning (yes, it was just a warning) BUT I still have the error for syntax on the line that asks for a new sequencer. i typed Sequencer player = new MidiSystem.getSequencer(); and the error says "MidiSystem.getSequencer cannot be resolved to a type" what should I do next?
EDIT: I figured out what I did wrong. I typed in "new" before MidiSystem.getSequencer(); which I didn't need because the method I'm calling is giving me a new object anyway, so it calls new, not me. thanks for the help. [ January 16, 2007: Message edited by: Eric Daly ]