private void portComboBox_itemStateChanged(ItemEvent event) {
        String selected = (String) event.getItem();
        if (event.getStateChange() == ItemEvent.SELECTED) {
            if (! selected.equals("-")) {
                openSerialPort((CommPortIdentifier) tableOfPorts.get(selected));
            }
            else {
                openSerialPort(null);
            }
        }
    }