Article View: borland.public.jbuilder.java.api
Article #2521javax.comm problem..
From: morbgra
Date: Thu, 05 Oct 2000 00:00
Date: Thu, 05 Oct 2000 00:00
37 lines
1894 bytes
1894 bytes
Where are my ports????
I used a very simple program
------
import javax.comm.*;
import java.util.*;
public class PortLister {
public static void main(String[] args) {
Enumeration e = CommPortIdentifier.getPortIdentifiers();
while (e.hasMoreElements()) {
System.out.println((CommPortIdentifier) e.nextElement());
}
}
}
------
It should report my ports on my computer, right?
compiling goes ok... Running also ok but the program does not go in the
while loop.
If i add this
Enumeration e = CommPortIdentifier.getPortIdentifiers();
System.out.println((CommPortIdentifier) e.nextElement());
System.out.println(e);
System.out.println(CommPortIdentifier.getPortIdentifiers());
I get
null (means i don't have ports? why not?)
javax.comm.CommPortEnumerator@129206 (an addres?)
javax.comm.CommPortEnumerator@30f13d (an addres?)
Do you know what i am doing wrong?
Greetings
Remko (mailto:morbus1@hotmail.com)
Technical Details
Message-ID:
<8ri633$q3j$1@nereid.worldonline.nl>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10a146,ae7eee89d9083c5,start X-Google-Attributes: gid10a146,public X-Google-Thread: f74b3,ae7eee89d9083c5,start X-Google-Attributes: gidf74b3,public X-Google-Thread: 1089d0,ae7eee89d9083c5,start X-Google-Attributes: gid1089d0,public From: "morbgra" <morbus1@hotmail.com> Subject: javax.comm problem.. Date: 2000/10/05 Message-ID: <8ri633$q3j$1@nereid.worldonline.nl> X-Deja-AN: 677908015 X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Complaints-To: newsmaster@worldonline.nl X-Trace: nereid.worldonline.nl 970759075 26739 195.240.230.115 (5 Oct 2000 15:17:55 GMT) Organization: WorldOnline - The Internet Communication Company X-MSMail-Priority: Normal NNTP-Posting-Date: 5 Oct 2000 15:17:55 GMT Newsgroups: borland.public.jbuilder.java.api,borland.public.jbuilder.java.language,comp.lang.java.programmer