import java.util.*;
import javax.comm.*;
public class ComTest {
    static Enumeration en = CommPortIdentifier.getPortIdentifiers();   
    static CommPortIdentifier portId; 
    public static void main(String[] args) { 
        while(en.hasMoreElements()){ 
            portId = (CommPortIdentifier)en.nextElement();
            if(portId.getPortType() == CommPortIdentifier.PORT_SERIAL){
             System.out.println(portId.getName());
            }
        }
    }
}
en.hasMoreElements()总是返回false,请问这是怎么回事情的哈?