public void setCurrentValues() {

		if (recent.isSelected()) {
			recent.doClick();
		}
		else {
			bookmark.doClick();
		}

		if (page.getSelectedText() != null) {
			int start = page.getSelectionStart();
			int end = page.getSelectionEnd();
			page.moveCaretPosition(end);
			page.requestFocusInWindow();
			page.select(start, end);
		}
		caretPosition = page.getCaretPosition();
		if (caretPosition >= 0) {
			Element elem = page.getStyledDocument().getCharacterElement(caretPosition - 1 < 0 ? 0 : caretPosition - 1);
			if (elem != null) {
				int startOffset = elem.getStartOffset();
				int endOffset = elem.getEndOffset();
				AttributeSet a = elem.getAttributes();
				String href = (String) a.getAttribute(HTML.Attribute.HREF);
				if (href != null) {
					urlField.setText(href);
					try {
						textLabel.setText(page.getText(startOffset, endOffset - startOffset));
					}
					catch (BadLocationException e) {
						textLabel.setText(null);
						urlField.setText(null);
					}
					page.requestFocusInWindow();
					page.select(startOffset, endOffset);
					urlField.setEnabled(true);
					clearButton.setEnabled(true);
					urlList.setEnabled(true);
					newWindowCheckBox.setEnabled(true);
				}
				else {
					String t = page.getSelectedText();
					boolean b = t != null;
					textLabel.setText(b ? t : "No text is selected.");
					urlField.setText(null);
					urlList.clearSelection();
					urlField.setEnabled(b);
					clearButton.setEnabled(b);
					urlList.setEnabled(b);
					newWindowCheckBox.setEnabled(b);
				}
				setNewWindowOptions(a);
			}
		}

	}