private void fillSelectedArea(int element) {
		boolean b = false;
		for (int k = 0; k < nAtom; k++) {
			if (selectedArea.contains(atom[k].getRx(), atom[k].getRy())) {
				b = true;
				break;
			}
		}
		if (obstacles != null) {
			int n = obstacles.size();
			if (n > 0) {
				for (int k = 0; k < n; k++) {
					if (selectedArea.intersects(obstacles.get(k))) {
						b = true;
						break;
					}
				}
			}
		}
		if (b) {
			JOptionPane.showMessageDialog(JOptionPane.getFrameForComponent(this), "There are objects in this area. Please select an empty area.", "Message", JOptionPane.ERROR_MESSAGE);
		} else {
			fillAreaWithAtoms(selectedArea, HEXAGONAL_LATTICE, element);
		}
		selectedArea.setSize(0, 0);
		repaint();
	}