Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Comm API

 
Rachel Swailes
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying a simple example with the Comm API so that I can get into it.

import javax.comm.*;
import java.util.Enumeration;

public class RachelTester {

public static void main(String args[]) {

try{
CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("LPT1");
}catch(NoSuchPortException snpe){System.out.println(snpe.toString());}

}

It compiles but the exception happens. But I have an LPT1 as I can see it in the device manager.

Can anyone tell me why the exception happens?

Thanks!
Rachel
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!