Eclipse 无法解析 MidiSystem.getSequencer()
Eclipse can't resolve MidiSystem.getSequencer()
Eclipse 抛出 错误:
"MidiSystem.getSequencer cannot be resolved to a type"
我是运行JavaSE- 1.7 with compliance level 1.7
不确定这里发生了什么
import javax.sound.midi.*;
public class drumKit{
public void play(){
try{
Sequencer sequencer = new MidiSystem.getSequencer();
System.out.println("got it");
}
catch(MidiUnavailableException ex){
System.out.println("Cannot find");
}
}
public static void main(String[] args){
drumKit d = new drumKit();
d.play();
}
}
getSequencer() 是一个静态方法,不需要使用 new
关键字
public void play(){
try{
Sequencer sequencer = MidiSystem.getSequencer();
System.out.println("got it");
}
Eclipse 抛出 错误:
"MidiSystem.getSequencer cannot be resolved to a type"
我是运行JavaSE- 1.7 with compliance level 1.7
不确定这里发生了什么
import javax.sound.midi.*;
public class drumKit{
public void play(){
try{
Sequencer sequencer = new MidiSystem.getSequencer();
System.out.println("got it");
}
catch(MidiUnavailableException ex){
System.out.println("Cannot find");
}
}
public static void main(String[] args){
drumKit d = new drumKit();
d.play();
}
}
getSequencer() 是一个静态方法,不需要使用 new
关键字
public void play(){
try{
Sequencer sequencer = MidiSystem.getSequencer();
System.out.println("got it");
}