Ho risolto per metà... ho applicato il finally alle ultime riga ossia in questo punto:
mettendolo così:codice:try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { Logger.getLogger(comApplet.class.getName()).log(Level.SEVERE, null, e); } try { outputStream.write(messageString.getBytes()); } catch (IOException e) { Logger.getLogger(comApplet.class.getName()).log(Level.SEVERE, null, e); }
ha funzionato, ha stampato ma ho ugualmente ottenuto l'errore della consolle java. ma credo sia perché ho impostato debug su on... provo a toglierlo... in ogni modo sei stato troppo gentile! Grazie!codice:try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { Logger.getLogger(comApplet.class.getName()).log(Level.SEVERE, null, e); } finally { try { outputStream.write(messageString.getBytes()); } catch (IOException e) { Logger.getLogger(comApplet.class.getName()).log(Level.SEVERE, null, e); } }![]()


Rispondi quotando