implementing SerialPortEventListener - java
-
28-05-2021 - |
Pergunta
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...
Solução
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.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow