private void changePlatform(String platform) {
        selectedPlatform = platform;
        Platform p = null;
        for (Platform p2 : availablePlatforms) {
            if (p2.getName().equals(selectedPlatform)) {
                p = p2;
                break;
            }
        }
        deviceListBox.clear();
        if (p == null) {
            return;
        }
        for (Device d : p.getDevices()) {
            deviceListBox.addItem(d.getName());
        }
        deviceListBox.selectItem(selectedDevice);
    }
@param args the command line arguments
jme3-examples/src/main/java/jme3test/opencl/TestContextSwitching.java