textareadocument.java
来自「java1.6众多例子参考」· Java 代码 · 共 56 行
JAVA
56 行
/* * @(#)TextAreaDocument.java 1.9 05/11/17 * * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */package javax.swing.text.html;import javax.swing.text.*;/** * TextAreaDocument extends the capabilities of the PlainDocument * to store the data that is initially set in the Document. * This is stored in order to enable an accurate reset of the * state when a reset is requested. * * @author Sunita Mani * @version 1.9 11/17/05 */ class TextAreaDocument extends PlainDocument { String initialText; /** * Resets the model by removing all the data, * and restoring it to its initial state. */ void reset() { try { remove(0, getLength()); if (initialText != null) { insertString(0, initialText, null); } } catch (BadLocationException e) { } } /** * Stores the data that the model is initially * loaded with. */ void storeInitialText() { try { initialText = getText(0, getLength()); } catch (BadLocationException e) { } }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?