private void floodFill(int mx, int my, int paintColor) {

		int w = screen.getWidth();
		int h = screen.getHeight();

		int searchColor = screen.getRGB(mx, my); 

		boolean[][] painted = new boolean[w][h];

		if(screen.getRGB(mx,my)==searchColor && !painted[mx][my]) {

			Queue<IntVector2D> queue = new LinkedList<IntVector2D>();
			queue.add(new IntVector2D(mx, my));

			while (!queue.isEmpty()) {
				IntVector2D p = queue.remove();

				if ((p.getX() >= 0) && (p.getX() < w &&
						(p.getY() >= 0) && (p.getY() < h))) {
					if (!painted[p.getX()][p.getY()] && (screen.getRGB((int)p.getX(), (int)p.getY())==searchColor)) {
						screen.setRGB(p.getX(), p.getY(), paintColor);
						painted[p.getX()][p.getY()] = true;

						queue.add(new IntVector2D(p.getX() + 1, p.getY()));
						queue.add(new IntVector2D(p.getX() - 1, p.getY()));
						queue.add(new IntVector2D(p.getX(), p.getY() + 1));
						queue.add(new IntVector2D(p.getX(), p.getY() - 1));

					}
				}
			}
		}

	}