Java Communications. ParallelPort

Advertisement

Java Communications. ParallelPort
Hi!
I have a question in Java Communications. I am trying to send the byte[] to the ParallelPort using the outputstream. Here is the code:
portList = CommPortIdentifier.getPortIdentifiers();
while (portList.hasMoreElements()) {
portId = (CommPortIdentifier) portList.nextElement();
portId.getPortType());
if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) {
try {
parallelPort = (ParallelPort) portId.open("MoodMusic", 2000);
} catch (PortInUseException e) { }
// Writing to port
try {
outputStream = parallelPort.getOutputStream();
outputStream.write("Hi".getBytes());
} catch (Exception e) { System.out.println(e.getMesssage());}
I was neither getting an Exception nor getting any response. The application just
freezes. The outputStream is not null. The port is not null as well. Could you help? The same code works perfectly well with SerialPort.
Repaly
one? If no, where can I find a Windows version?Here:
http://onesearch.sun.com/search/onesearch/index.jsp?qt=Java+Communications+for+Windows&subCat=siteforumid%3Ajava31&site=dev&dftab=siteforumid%3Ajava31&chooseCat=javaall&col=developer-forums
And have a look at RXTX. There is no Windows version anymore because MS changed the specs for the interface.
Read More: The other 5 answers