private PageTextBox createTextBox() {
			PageTextBox t = new PageTextBox();
			t.setIndex(indexOfComponent++);
			if (uid != null) {
				t.setUid(uid);
				uid = null;
			}
			if (titleText != null && titleText.trim().length() >= 6) {
				t.setContentType(titleText.trim().substring(0, 6).toLowerCase().equals("<html>") ? "text/html"
						: "text/plain");
			}
			else {
				t.setContentType("text/plain");
			}
			t.setPage(page);
			if (!opaque) {
				t.setOpaque(false);
				opaque = true;
			}
			else {
				if ((argb1 | ARGB_NOT_SET) != ARGB_NOT_SET) {
					t.setBackground(new Color(argb1));
					argb1 = ARGB_NOT_SET;
				}
			}
			if (borderType != null) {
				t.setBorderType(borderType);
				t.putClientProperty("border", borderType);
				borderType = null;
			}
			t.setChangable(page.isEditable());
			if (width > 0 && height > 0) {
				if (width > 1 && height > 1) {
					t.setPreferredSize(new Dimension((int) width, (int) height));
				}
				else {
					// width and height are specified as percentages to the page's size
					if (width < 1.05f) {
						t.setWidthRelative(true);
						t.setWidthRatio(width);
						width *= page.getWidth();
					}
					if (height < 1.05f) {
						t.setHeightRelative(true);
						t.setHeightRatio(height);
						height *= page.getHeight();
					}
					t.setPreferredSize(new Dimension((int) width, (int) height));
				}
				width = height = 0;
			}
			boolean needCache = ConnectionManager.sharedInstance().isCachingAllowed() && page.isRemote();
			if (titleText != null) {
				if (needCache) {
					File cml = ConnectionManager.sharedInstance().getLocalCopy(page.getAddress());
					if (cml != null && cml.exists())
						t.setBase(cml);
				}
				t.decodeText(titleText);
				titleText = null;
				// if (needCache) t.setBase(page.getURL());
				/**
				 * WARNING: if we restore the document base now, the resource files will load in correctly because their
				 * loader threads will presumably use the original document base. This has two consequencies. First, the
				 * resources cannot be loaded offline (since the loaders that are seeking to download the resources from
				 * remote sites will not be able to download). Second, there will not be caching for for the source
				 * files because the HTML document will be redirected to remote files and there is no built-in caching
				 * mechanism in the default HTML loading in a HTMLDocument. So we must NOT restore the document base
				 * until all the sources have been loaded.
				 * 
				 * If we do not restore the document base, there is one consequence. All the links within the text box
				 * will point to the cached files. If there are no links, then I would say that we may not bother to
				 * restore the document base, as the text box contains no ACTIVE pieces. So it is really the links that
				 * requires base restoration.
				 * 
				 * So where and when do we restore the document base? As for the timing, I think it is pretty clear that
				 * the restoration has to happen AFTER all the sources have been loaded. The good news is that since we
				 * are now able to use cached files, the loading process should be rapid. So an optimal place to restore
				 * the base is actually the first time when the user is about to click a link. There are two places in
				 * Page: hyperlinkUpdate(HyperlinkEvent e) and hotlinkUpdate(HyperlinkEvent e).
				 * 
				 * (One of them is actually for making image map work.)
				 */
				if (needCache) // FIXME: Do we want to check caching for all linked files?
					t.cacheLinkedFiles(page.getPathBase());
			}
			htmlComponentConnector.enroll(t);
			return t;
		}