try { int id = imageData.getId(); int page = imageData.getPage(); ImageData[] images = searchModel.getPage(page); for (int i = 0; i < images.length; i++) { if (images[i].getId() == id) { selectedImgModel.setImageData(images[i]); break; } } } catch (IOException e1) {  e1.printStackTrace(); }
selectedImgModel.setImageData(imageData);
		public void mouseClicked(MouseEvent e) {			try {				int id = imageData.getId();				int page = imageData.getPage();				ImageData[] images = searchModel.getPage(page);				for (int i = 0; i < images.length; i++) {					if (images[i].getId() == id) {						selectedImgModel.setImageData(images[i]);						break;					}				}			} catch (IOException e1) {				// TODO Auto-generated catch block				e1.printStackTrace();			}		}