private void drawBorder(Graphics g)
	{
		//First initialise colour
		Color borderColour = slidePanel.getBackground();

		//Set flags (for use in creating the border) for whether the zoomed
		//image takes the full height and/or width of the slide area
		Boolean isFullWidth = false;
		Boolean isFullHeight = false;

		if(hostSize.getWidth() == zoomedSize.width)
			isFullWidth = true;
		if(hostSize.getHeight() == zoomedSize.height)
			isFullHeight = true;

		//Check flags isFullWidth and isFullHeight to ensure border does not
		//go outside slide area. If one of the flags is true, its corresponding
		//size and position variables will omit the border thickness from
		//their calculation (so the border will end at any image edge
		//that contacts the slide edge
		int borderWidth;
		int borderHeight;
		int x;
		int y = zoomedPosition.y - borderThickness;

		//Check horizontal
		if(isFullWidth)
		{
			borderWidth = zoomedSize.width;
			x = zoomedPosition.x;
		}
		else
		{
			borderWidth = zoomedSize.width + 2*borderThickness;
			x = zoomedPosition.x - borderThickness;
		}

		//Check vertical
		if(isFullHeight)
		{
			borderHeight = zoomedSize.height;
			y = zoomedPosition.y;
		}
		else
		{
			borderHeight = zoomedSize.height + 2*borderThickness;
			y = zoomedPosition.y - borderThickness;
		}

		//Debug messages to verify correct sizing and positioning of border
		if(Debug.imagePlayer) System.out.println("Border panel will be drawn at ("+
				x+","+y+") with dimensions "+
				borderWidth+" x "+borderHeight);

		//Draw the first rectangle which will define the border
		g.setColor(borderColour);
		g.fillRect(x, y, borderWidth, borderHeight);

		//Draw the second rectangle which will give a white background to any
		//image with transparency
		g.setColor(Color.WHITE);
		g.fillRect(zoomedPosition.x, zoomedPosition.y,
					zoomedSize.width, zoomedSize.height);
	}