Question

I am trying to implement SerialPortEventListener but failed. My code is

public class Communicator implements SerialPortEventListener{

My netbeans 7.1 shows mateorssms.Communicator is not abstract and does not override abstract method serialEvent(javax.comm.SerialPortEvent) in javax.comm.SerialPortEventListener. I've successfully imported javax.comm.*;. What is wrong with me?

Thanks in advance...

Was it helpful?

Solution

Your Communicator class needs a to implement a method

@Override
public void serialEvent(SerialPortEvent ev) {
  // TODO do something with ev
}

That's all. Add this method stub to your class and the error is gone. Then add some functionality to that method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top