public void SwitchTo() {
		String[] text = frame.getJJTextPane().getText().split("\n");
		String str = JOptionPane.showInputDialog(frame, "行数(L):", "转到下列行",
				JOptionPane.QUESTION_MESSAGE);
		if (str != null)// str==null是点击了取消按钮触发的事件
		{
			Pattern pattern = Pattern.compile("[0-9]");
			if (str.trim().length() != 0 && pattern.matcher(str).matches()) {
				int row = Integer.parseInt(str);
				if (row >= 1 && row <= text.length) {
					int pos = 0;
					for (int i = 0; i < row - 1; i++) {
						pos += text[i].length() + 1;
					}
					frame.getJJTextPane().setCaretPosition(pos);
				} else {
					JOptionPane.showMessageDialog(frame, "列数超出范围！", "错误提示",
							JOptionPane.ERROR_MESSAGE);
				}
			} else {
				JOptionPane.showMessageDialog(frame, "无效的字符！", "错误提示",
						JOptionPane.ERROR_MESSAGE);
			}
		}
	}