@Override
	protected void paintComponent(Graphics g) {
		super.paintComponent(g);
			switch (displayedToolIndex) {
			case 1:
				if (this.getComponentCount() == 0) {
					this.add(imageIcon);
				}
				imageIcon.setLocation(new Point((int)startPoint.getX()-12, (int)startPoint.getY()-12));
				break;
			case 2:
				if (this.getComponentCount() > 0) {
					this.remove(imageIcon);
				}
				g.drawLine((int)startPoint.getX(), (int)startPoint.getY(), (int)endPoint.getX(), (int)endPoint.getY());
				break;
			case 3:
				if (this.getComponentCount() > 0) {
					this.remove(imageIcon);
				}
				g.drawPolygon(
						new int[] {(int)startPoint.getX(), (int)endPoint.getX(),(int)endPoint.getX(),(int)startPoint.getX()}, 
						new int[] {(int)startPoint.getY(),(int)startPoint.getY(), (int)endPoint.getY(),(int)endPoint.getY()}, 
						4);
				break;
			}

	}