private void discoverDevices() {
		tvDiscoveryService = TvDiscoveryService.getInstance(swingPlatform);
        // discovering devices can take time, so do it in a thread
        new Thread(new Runnable() {
        	public void run() {
        		showProgressDialog(resourceBundle.getString("progress.discoveringDevices"));
        		devices = tvDiscoveryService.discoverTvs();
        		deviceList.removeAllItems();
                deviceList.addItem(resourceBundle.getString("devices.select"));  // no selection option
        		for(TvDevice device:devices) {
        			deviceList.addItem(device.getName()+" / "+device.getAddress().getHostName());
        		}
        		
        		Properties properties = loadProperties();
        		// add the manual IPs to the device list
    			for(TvDevice device:manualDevices) {
    				boolean alreadyFound = false;
    				for(TvDevice foundDevice:devices) {
    					if (foundDevice.getAddress().getHostAddress().equals(device.getAddress().getHostAddress())) {
    						alreadyFound = true;
    						break;
    					}
            		}
    				if (!alreadyFound) {
						deviceList.addItem(device.getAddress().getHostName());
						devices.add(device);
					}
    			}
    			
    			deviceList.invalidate();
    			hideProgressDialog();
    			
    			// automatically connect to the last connected device
        		if (startup) {
        			startup = false;
        			String lastDevice = properties.getProperty(PROPERTY_LAST_DEVICE);
        			if (lastDevice!=null) {
    		    		int pos = 1;
    		    		for(TvDevice device:devices) {
    			    		if (device.getAddress().getHostAddress().equals(lastDevice)) {
    			    			deviceList.setSelectedIndex(pos);
    			    			break;
    			    		}
    			    		pos++;
    			    	}	
        			}
        		}
        	}
        }).start();
	}