MenuBar.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:Brino 作者:
public void setComs() {
    ArrayList<String> comList = new ArrayList<String>();
    Enumeration<CommPortIdentifier> comm = CommPortUtils.getComPorts();
    while (comm.hasMoreElements()) {
        CommPortIdentifier port_identifier = (CommPortIdentifier) comm
                .nextElement();
        if (port_identifier.getPortType() == CommPortIdentifier.PORT_SERIAL) {
            // if (!comOldList.contains(port_identifier.getName()))
            comList.add(port_identifier.getName());
        }
    }
    if (comList.isEmpty()) {
        addCom("N�o h� portas dispon�veis");
    } else {
        addCom(comList);
    }

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号