你好我有樂趣的Arduino:d顯示的serialEvent在JLabel的
而且我的serialEvent
public synchronized void serialEvent(SerialPortEvent oEvent) {
if (oEvent.getEventType() == SerialPortEvent.DATA_AVAILABLE) {
try {
String inputLine = input.readLine();
System.out.println(inputLine);
} catch (Exception e) {
System.err.println(e.toString());
}
}
}
如何看起來應該像代碼以顯示在一個JLabel(的Java Swing)文本
lblText.setText(inputLine.toString());
但我有錯誤inputLine cannot be resolved
這裏是代碼http://pastebin.com/qEhafEhp –