public void actionPerformed(ActionEvent e) {

		JButton button = (JButton) e.getSource();
		Dimension size = button.getSize();

		int labelX = label.getX();
		int labelY = label.getY();
		int buttonX = button.getX();
		int buttonY = button.getY();
		int buttonPosX = buttonX / size.width;
		int buttonPosY = buttonY / size.height;
		int buttonIndex = pos[buttonPosY][buttonPosX];


		if (labelX == buttonX && (labelY - buttonY) == size.height) {

			int labelIndex = buttonIndex + 3;

			centerPanel.remove(buttonIndex);
			centerPanel.add(label, buttonIndex);
			centerPanel.add(button, labelIndex);
			centerPanel.validate();
		}

		if (labelX == buttonX && (labelY - buttonY) == -size.height) {

			int labelIndex = buttonIndex - 3;
			centerPanel.remove(labelIndex);
			centerPanel.add(button, labelIndex);
			centerPanel.add(label, buttonIndex);
			centerPanel.validate();
		}

		if (labelY == buttonY && (labelX - buttonX) == size.width) {

			int labelIndex = buttonIndex + 1;

			centerPanel.remove(buttonIndex);
			centerPanel.add(label, buttonIndex);
			centerPanel.add(button, labelIndex);
			centerPanel.validate();
		}

		if (labelY == buttonY && (labelX - buttonX) == -size.width) {

			int labelIndex = buttonIndex - 1;

			centerPanel.remove(buttonIndex);
			centerPanel.add(label, labelIndex);
			centerPanel.add(button, labelIndex);
			centerPanel.validate();
		}
	}