if (progressModel == null) throw new NullPointerException("progressModel == null"); this.progressModel = progressModel; progressModel.addObserver(this);  if (selectedImgModel == null) throw new NullPointerException("selectedImgModel == null"); this.selectedImgModel = selectedImgModel;
	public ExamplesPanel(ExamplesModel examplesModel, SearchModel searchModel) {		super(new BorderLayout());				if (examplesModel == null)			throw new NullPointerException("examplesModel == null");		this.examplesModel = examplesModel;		examplesModel.addObserver(this);				if (searchModel == null)			throw new NullPointerException("searchModel == null");		this.searchModel = searchModel;				examplesPanel = new JPanel(new FlowLayout(FlowLayout.LEFT,5,0));		JScrollPane scrollPane = new JScrollPane(examplesPanel);		scrollPane.setBorder(null);		scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);				JPanel containerPanel = new JPanel(new GridLayout(1,1));		containerPanel.setBorder(BorderFactory.createTitledBorder("Example images"));		containerPanel.add(scrollPane);		add(containerPanel);				firstButton = new JButton("Use first as examples");		firstButton.setActionCommand("useFirst");		firstButton.addActionListener(this);		firstButton.setAlignmentX(JButton.CENTER_ALIGNMENT);		reorderButton = new JButton("Reorder results");		reorderButton.setActionCommand("reorder");		reorderButton.addActionListener(this);		reorderButton.setAlignmentX(JButton.CENTER_ALIGNMENT);		clearButton = new JButton("Clear examples");		clearButton.setActionCommand("clear");		clearButton.addActionListener(this);		clearButton.setAlignmentX(JButton.CENTER_ALIGNMENT);		clearButton.setEnabled(false);				JPanel buttonsPanel = new JPanel();		buttonsPanel.setBorder(BorderFactory.createEmptyBorder(10,10,5,10));		GridLayout gl = new GridLayout(3,1);		gl.setHgap(5);		gl.setVgap(5);		buttonsPanel.setLayout(gl);		buttonsPanel.add(firstButton);		buttonsPanel.add(reorderButton);		buttonsPanel.add(clearButton);		add(buttonsPanel, BorderLayout.EAST);	}