public void insert(int v) {
		// ʾ
		state = State.insert;
		data = v;
		repaint();
		paintAll(getGraphics());

		// ͬԪأʧܡ
		if (shortSearch(v))
			Message.SameElement();
		else if (root == null) {

			root = new BTreeNode(rootX, rootY);
			root.add(v);
			repaint();

		} else {

			// ͷҪѣһµĽڵ
			if (root.numOfElements == m - 1) {
				BTreeNode newNode = new BTreeNode(rootX, rootY); // ȡԭڵ
				// newNode.value[1] = root.value[mid];
				root.numOfElements = mid - 1;
				split(newNode, 1, root);
				int x = cnt.getNextPos(0, mid - 1);
				root.setPoint(rootX + x, rootY + HEIGHT * 3); // ޸ԭڵλ
				root = newNode; // rootָͷ
				root.isLeaf = false;
				Recount();
				repaint();

			}
			// һв
			p = root;

			if (p == null)
				return;

			while (!p.isLeaf) { // δҶڵ

				// Ч
				p.color = Color.RED;
				repaint();
				paintAll(getGraphics());

				try {
					Thread.sleep(TIME);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				p.color = Color.BLACK;
				repaint();
				paintAll(getGraphics());

				int i;
				for (i = 1; i <= p.numOfElements; i++) {
					p.ElementHighlightIdx = i;
					repaint();
					paintAll(getGraphics());
					try {
						Thread.sleep(TIME);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
					if (p.value[i] > v) {
						break;
					}
				}
				p.ElementHighlightIdx = -1;
				repaint();
				paintAll(getGraphics());

				BTreeNode temp;
				state = State.go;
				// p½ʵλ
				if (i <= p.numOfElements) {
					temp = p.children[i - 1];
					p.lineHighlightIdx = i-1;
					node = i-1;
					repaint();
					paintAll(getGraphics());

					try {
						Thread.sleep(TIME);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
				} else {
					temp = p.children[p.numOfElements]; // ֹԽ
					p.lineHighlightIdx = p.numOfElements;
					node = p.numOfElements;
					repaint();
					paintAll(getGraphics());
					try {
						Thread.sleep(TIME);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
				}
				p.lineHighlightIdx = -1;
				repaint();
				paintAll(getGraphics());

				if (temp.numOfElements == m - 1) {
					split(p, i, temp);
					Recount();
					p = root;
				} else
					p = temp;

			}
			// Ҷڵ㣬Ԫ
			p.add(v);
		}

		state = State.inserted;
		repaint();
		paintAll(getGraphics());

	}