private void loadState(File file) {
		try {
			//use buffering
			InputStream fileStream = new FileInputStream(file);
			InputStream buffer = new BufferedInputStream(fileStream);
			ObjectInput input = new ObjectInputStream (buffer);
			try {
				pdbFile = (File)input.readObject();
				media = (ArrayList<AlignmentMedium>)input.readObject();
		    }
		    finally {
		    	input.close();
		    	refreshMediaPane();
		    	picLabel3.setIcon(iconOK);
		    	
		    	// Find at least one non-empty RDC set, and use its sequence to update the current sequence
		    	for(AlignmentMedium medium: media) {
		    		if(medium.getCount() > 0) {
		    			sequence = medium.getRDCSets().get(0).getSequence();
		    			break;
		    		}
		    	}
		    	
		    	// Update the state icon for sequence
		    	if(sequence.getLength()==0)
		    		picLabel1.setIcon(iconStop);
		    	else
		    		picLabel1.setIcon(iconOK);
		    	
		    	// Update the state icon for PDB file
		    	if(pdbFile == null)
		    		picLabel2.setIcon(iconStop);
		    	else
		    		picLabel2.setIcon(iconOK);				    	
		    }
		}
		catch(ClassNotFoundException ex){
			ex.printStackTrace();
		}
		catch(IOException ex){
			ex.printStackTrace();
		}
	}