How to use readLine from JSSC
The event gets fired when a single character is received, not the whole string. You have to build the string up until you get to \r\n and then process it. This is my code for a similar project. It uses a protocol where &gt; signifies the start of a message and \r signifies the end. processMessage is a function to process the entire message and update GUI elements etc. It is invoked using runLater because the serialEvent function will be on a different thread to the GUI thread.

StringBuilder message = new StringBuilder();
Boolean receivingMessage = false;
public void serialEvent(SerialPortEvent event) {
    if(event.isRXCHAR() &amp;&amp; event.getEventValue() &gt; 0){
        try {
            byte buffer[] = serialPort.readBytes();
            for (byte b: buffer) {
                if (b == '&gt;') {
                    receivingMessage = true;
                    message.setLength(0);
                }
                else if (receivingMessage == true) {
                    if (b == '\r') {
                        receivingMessage = false;
                        String toProcess = message.toString();
                        Platform.runLater(new Runnable() {
                            @Override public void run() {
                                processMessage(toProcess);
                           }
                        });
                    }
                    else {
                        message.append((char)b);
                    }
                }
            }                
        }
        catch (SerialPortException ex) {
            System.out.println(ex);
            System.out.println("serialEvent");
        }
    }
}


A simpler version for you might be the following. processMessage is called whenever a \r or \n is received and there are some bytes in the message.

StringBuilder message = new StringBuilder();
public void serialEvent(SerialPortEvent event) {
    if(event.isRXCHAR() &amp;&amp; event.getEventValue() &gt; 0){
        try {
            byte buffer[] = serialPort.readBytes();
            for (byte b: buffer) {
                    if ( (b == '\r' || b == '\n') &amp;&amp; message.length() &gt; 0) {
                        String toProcess = message.toString();
                        Platform.runLater(new Runnable() {
                            @Override public void run() {
                                processMessage(toProcess);
                           }
                        });
                        message.setLength(0);
                    }
                    else {
                        message.append((char)b);
                    }
            }                
        }
        catch (SerialPortException ex) {
            System.out.println(ex);
            System.out.println("serialEvent");
        }
    }
}


Edit:

Two things fixed:  1. Using StringBuilder instead of String to save making a lot objects every time the message is incremented. 2. Make a copy of the message string before passing to runLater otherwise when it does run it will use the up to date version of the string, which could have new characters, and thus cause problems.

Edt 2:
On Windows I found it needed if(event.isRXCHAR() &amp;&amp; event.getEventValue() &gt; 0) as the event would sometimes be fired with 0 bytes causing a null point exception in for (byte b: buffer)