public void setValue(int val) { /* * Set the new threshold. */ if (port != null) { if (val > 0) { try { port.enableReceiveThreshold(val); } catch (UnsupportedCommOperationException ucoe) { ucoe.printStackTrace(); } } else { port.disableReceiveThreshold(); } } this.showValue(); }