public void paintComponent(Graphics g){
		super.paintComponent(g); //first draw the actual image		
		if (displayImage == null) // quit if there's no image to load...
			return;
		else
			displayImage.setPanel(this);
		
		int p_width = this.getWidth();
		int p_height = this.getHeight();
		int i_width = this.displayImage.getWidth();
		int i_height = this.displayImage.getHeight();
		
		int x_0 = (p_width-i_width)/4;
		int y_0 = (p_height-i_height)/4;
		
		if ( x_0 < 0 ) x_0 = 0;
		if ( y_0 < 0 ) y_0 = 0;

		for (BufferedImage isOverImage:isOverImages){
        	g.drawImage(isOverImage,x_0,y_0,i_width,i_height,null);//draw on top of original image
		}
        for (BufferedImage isCentroidOverImage:isCentroidOverImages)
        	g.drawImage(isCentroidOverImage,x_0,y_0,i_width,i_height,null);//draw on top of original image
		if (seeTrainPoints){
			if (trainPointsOverImage == null)
				trainPointsOverImage=new BufferedImage(displayImage.getWidth(),displayImage.getHeight(),BufferedImage.TYPE_INT_ARGB);
			if (redrawImage)
				ReDrawOverImageFromScratch();		
	        g.drawImage(trainPointsOverImage,x_0,y_0,i_width,i_height,null);//draw on top of original image
		}
		if (seeErrors)
			g.drawImage(errorOverlay,x_0,y_0,i_width,i_height,null);//draw on top of original image			
	}