private void refreshInputs() {
        System.out.println("Searching for input devices...");
        refreshing = true;

        //get the available midi devices from MidiSystem
        synth.availableInputDevices = new ArrayList(Arrays.asList(MidiSystem.getMidiDeviceInfo()));
        //try to create a new transmitter on each.  I this fails, it isn't an input device.
        //remove it and start the loop over on the updated list so we don't overflow.
        for (int i = 0; i < synth.availableInputDevices.size(); i++) {
            try {
                MidiSystem.getMidiDevice(synth.availableInputDevices.get(i)).getTransmitter();
                //if it worked, close the device explicitly and continue testing
                MidiSystem.getMidiDevice(synth.availableInputDevices.get(i)).close();
            } catch (MidiUnavailableException mue) {
                synth.availableInputDevices.remove(i);
                i = 0;
            }
        }

        //replace the contents of inputDevicesComboBox with the contents of the refreshed list
        deviceListComboBox.removeAllItems();
        for (int i = 0; i < synth.availableInputDevices.size(); i++) {
            deviceListComboBox.addItem(synth.availableInputDevices.get(i).getName()
                    + " : " + synth.availableInputDevices.get(i).getDescription());
        }

        refreshing = false;
        System.out.println("Found " + synth.availableInputDevices.size() + " devices!\n");
    }